### Question:
LocalCLusterService { public List<TopologyState> getTopologyStates() { List<TopologySummary> summaries = cluster.getClusterInfo().get_topologies(); List<TopologyState> states = new ArrayList<>(summaries.size()); for (TopologySummary summary : summaries) { PythianToplogyConfiguration topology = topologyRepository.findById(summary.get_name()); if (topology != null) { states.add(new TopologyState(topology.getId(), topology.getName(), fromStormStatus(summary.get_status()))); } } return states; }  void launch(String topologyId); void kill(String topologyId); List<TopologyState> getTopologyStates(); TopologyState getTopologyState(String topologyId);  }### Answer:
@Test public void should_retrieve_topology_states() { PythianToplogyConfiguration topology1 = new PythianToplogyConfiguration("1", "topology 1"); PythianToplogyConfiguration topology2 = new PythianToplogyConfiguration("2", "topology 2"); PythianToplogyConfiguration topology3 = new PythianToplogyConfiguration("3", "topology 3"); given(topologyRepository.findById("1")).willReturn(topology1); given(topologyRepository.findById("2")).willReturn(topology2); given(topologyRepository.findById("3")).willReturn(topology3); TopologySummary expectedTopologySummary1 = new TopologySummary(random(6), "1", 1, 1, 1, 1, "ACTIVE"); TopologySummary expectedTopologySummary2 = new TopologySummary(random(6), "2", 2, 2, 2, 2, "KILLED"); given(cluster.getClusterInfo().get_topologies()).willReturn(asList(expectedTopologySummary1, expectedTopologySummary2)); List<TopologyState> states = service.getTopologyStates(); assertThat(states).containsOnly( new TopologyState("1", "topology 1", DEPLOYED), new TopologyState("2", "topology 2", UNDEPLOYING) ); }