in src/main/java/org/apache/sling/api/resource/path/PathSet.java [98:113]
private static void optimize(final Set<Path> set) {
final Iterator<Path> i = set.iterator();
while (i.hasNext()) {
final Path next = i.next();
boolean found = false;
for (final Path p : set) {
if (p != next && p.matches(next.getPath())) {
found = true;
break;
}
}
if (found) {
i.remove();
}
}
}