+ /**
+ * Comparator based on augment target path.
+ */
+ private static final Comparator<AugmentationSchema> AUGMENT_COMP = (o1, o2) -> {
+ final Iterator<QName> thisIt = o1.getTargetPath().getPathFromRoot().iterator();
+ final Iterator<QName> otherIt = o2.getTargetPath().getPathFromRoot().iterator();
+
+ while (thisIt.hasNext()) {
+ if (!otherIt.hasNext()) {
+ return 1;
+ }
+
+ final int comp = thisIt.next().compareTo(otherIt.next());
+ if (comp != 0) {
+ return comp;
+ }
+ }
+
+ return otherIt.hasNext() ? -1 : 0;
+ };
+