Returns true if prospectiveChild can be legally added to parent. False is returned if:
prospectiveChild
parent
Throws an error if parent or prospectiveChild is null/undefined.
Parent to add to
Prospective child
Equality function
Returns true if
prospectiveChild
can be legally added toparent
. False is returned if:parent
andprospectiveChild
are equalparent
already containsprospectiveChild
prospectiveChild
hasparent
as its own childThrows an error if
parent
orprospectiveChild
is null/undefined.