default boolean isDescendantOf(@Nonnull PathNode<?> other) {
		// If our type identifiers are the same everything going up the path should match.
		String otherTypeId = other.typeId();
		if (otherTypeId.equals(typeId()))
			return hasEqualOrChildValue(other) && allParentsMatch(other);

		// Check if the other is an allowed parent.
		PathNode<?> parent = getParent();
		if (directParentTypeIds().contains(otherTypeId) && parent != null) {
			// The parent is an allowed type, check if the parent says it is a descendant of the other path.
			if (parent == other || (parent.hasEqualOrChildValue(other)))
				return parent.isDescendantOf(other);
		}

		// Check in parent.
		if (parent != null)
			return parent.isDescendantOf(other);

		// Not a descendant.
		return false;
	}
@param other
		Some other path node.

@return {@code true} when our path represents a more specific path than the given one.
{@code false} when our path does not belong to a potential sub-path of the given item.
recaf-core/src/main/java/software/coley/recaf/path/PathNode.java