AggregatingNodeDataResolver implements NodeDataResolver { @Override public Map<String, Node> resolve() { Map<String, Node> result = new HashMap<>(); delegates.forEach(delegate -> result.putAll(delegate.resolve())); return result; } AggregatingNodeDataResolver(List<NodeDataResolver> delegates); @Override Map<String, Node> resolve(); @Override long getStalenessMs();  }
@Test public void testAggregation() { AggregatingNodeDataResolver resolver = new AggregatingNodeDataResolver(asList( newDelegate("node1", 1), newDelegate("node2", 2)) ); assertThat(resolver.resolve()).hasSize(2); }