in src/main/java/org/apache/sling/discovery/base/commons/ClusterViewHelper.java [32:43]
public static boolean contains(ClusterView clusterView, String slingId) throws UndefinedClusterViewException {
InstanceDescription found = null;
for (InstanceDescription i : clusterView.getInstances()) {
if (i.getSlingId().equals(slingId)) {
if (found!=null) {
throw new IllegalStateException("multiple instances with slingId found: "+slingId);
}
found = i;
}
}
return found!=null;
}