@Test public void getInstanceById() { Cluster.Instance instance = cluster.getInstanceMatching(withIds("id-0")); assertThat(instance.getRoles().contains("role-0"), is(true)); }
public Instance getInstanceMatching(Predicate<Instance> predicate) { return Iterables.getOnlyElement(Sets.filter(instances, predicate)); }
Cluster { public Instance getInstanceMatching(Predicate<Instance> predicate) { return Iterables.getOnlyElement(Sets.filter(instances, predicate)); } }
Cluster { public Instance getInstanceMatching(Predicate<Instance> predicate) { return Iterables.getOnlyElement(Sets.filter(instances, predicate)); } Cluster(Set<Instance> instances);  Cluster(Set<Instance> instances, Properties configuration); }
Cluster { public Instance getInstanceMatching(Predicate<Instance> predicate) { return Iterables.getOnlyElement(Sets.filter(instances, predicate)); } Cluster(Set<Instance> instances);  Cluster(Set<Instance> instances, Properties configuration); static Cluster empty(); Set<Instance> getInstances(); Properties getConfiguration(); Instance getInstanceMatching(Predicate<Instance> predicate); Set<Instance> getInstancesMatching(Predicate<Instance> predicate); void removeInstancesMatching(Predicate<Instance> predicate); String toString(); }
Cluster { public Instance getInstanceMatching(Predicate<Instance> predicate) { return Iterables.getOnlyElement(Sets.filter(instances, predicate)); } Cluster(Set<Instance> instances);  Cluster(Set<Instance> instances, Properties configuration); static Cluster empty(); Set<Instance> getInstances(); Properties getConfiguration(); Instance getInstanceMatching(Predicate<Instance> predicate); Set<Instance> getInstancesMatching(Predicate<Instance> predicate); void removeInstancesMatching(Predicate<Instance> predicate); String toString();  }