in src/main/java/org/apache/sling/discovery/base/commons/DefaultTopologyView.java [213:226]
public Set<InstanceDescription> findInstances(final InstanceFilter picker) {
if (picker == null) {
throw new IllegalArgumentException("picker must not be null");
}
Set<InstanceDescription> result = new HashSet<InstanceDescription>();
for (Iterator<InstanceDescription> it = instances.iterator(); it
.hasNext();) {
InstanceDescription instance = it.next();
if (picker.accept(instance)) {
result.add(instance);
}
}
return result;
}