diff --git a/src/test/java/org/elasticsearch/test/TestCluster.java b/src/test/java/org/elasticsearch/test/TestCluster.java index fcbff577ed9..2cffc96adff 100644 --- a/src/test/java/org/elasticsearch/test/TestCluster.java +++ b/src/test/java/org/elasticsearch/test/TestCluster.java @@ -474,7 +474,15 @@ public class TestCluster implements Closeable, Iterable { public synchronized ClusterService clusterService() { return getInstance(ClusterService.class); } - + + public synchronized Iterable getInstances(Class clazz) { + List instances = new ArrayList(nodes.size()); + for (NodeAndClient nodeAndClient : nodes.values()) { + instances.add(getInstanceFromNode(clazz, nodeAndClient.node)); + } + return instances; + } + public synchronized T getInstance(Class clazz, final String node) { final Predicate predicate; if (node != null) {