private int comparePathElements(final PathElement here, final PathElement there) { final int result = here.getKind().compareTo(there.getKind()); if (result != 0) { return result; } else if (here.getNameOrId() == null && there.getNameOrId() == null) { return compareToWithIdentityHash(here, there); } else if (here.hasId()) { return there.hasId() ? Long.compare(here.getId(), there.getId()) : -1; } else { return there.hasId() ? 1 : here.getName().compareTo(there.getName()); } }
return compareToWithIdentityHash(this.raw, other.raw);