@Override
	public int localCompare(PathNode<?> o) {
		if (this == o) return 0;

		if (o instanceof ClassMemberPathNode classMemberNode) {
			ClassMember member = getValue();
			ClassMember otherMember = classMemberNode.getValue();

			// Show fields first
			if (member.isField() && otherMember.isMethod()) {
				return -1;
			} else if (member.isMethod() && otherMember.isField()) {
				return 1;
			}

			int cmp;
			ClassPathNode parent = getParent();
			if (parent != null) {
				ClassPathNode otherParent = classMemberNode.getParent();
				if (otherParent != null) {
					cmp = parent.compareTo(otherParent);
					if (cmp != 0)
						return cmp;
				}

				// Sort by appearance order in parent.
				ClassInfo classInfo = parent.getValue();
				List<? extends ClassMember> list = member.isField() ?
						classInfo.getFields() : classInfo.getMethods();
				if (list.size() > MemberIndexAcceleratorProperty.CUTOFF) {
					MemberIndexAcceleratorProperty accel = MemberIndexAcceleratorProperty.get(classInfo);
					cmp = Integer.compare(accel.indexOf(member), accel.indexOf(otherMember));
				} else {
					cmp = Integer.compare(list.indexOf(member), list.indexOf(otherMember));
				}
			} else {
				// Just sort alphabetically if parent not known.
				String key = member.getName() + member.getDescriptor();
				String otherKey = otherMember.getName() + member.getDescriptor();
				cmp = CaseInsensitiveSimpleNaturalComparator.getInstance().compare(key, otherKey);
			}
			return cmp;
		}

		// Show after inner classes & annotations
		if (o instanceof InnerClassPathNode || o instanceof AnnotationPathNode)
			return 1;

		return 0;
	}
@param insn
		Instruction to wrap into node.
@param index
		Index of the instruction within the method code.

@return Path node of instruction, with the current member as parent.
recaf-core/src/main/java/software/coley/recaf/path/ClassMemberPathNode.java