### Question:
ClusterService { public Cluster getCluster(String clusterId) { Cluster cluster = clusters.get(clusterId); if (cluster == null) { throw new EntityNotFoundException( "Cluster with the specified ID not found: ID = " + clusterId); } return cluster; } @Inject  ClusterService(StormEngine stormEngine, StreamflowConfig streamflowConfig); Collection<Cluster> listClusters(); Cluster addCluster(Cluster cluster); Cluster getCluster(String clusterId); void deleteCluster(String clusterId); void updateCluster(String clusterId, Cluster cluster); ClusterSummary getClusterSummary(String clusterId);  }### Answer:
@Test public void getClusterWithValidId() { Cluster cluster = clusterService.getCluster("test"); assertNotNull("Retrieved cluster should not be null with a valid id", cluster); assertEquals("Retrieved cluster name should match the requested cluster id", "Test Cluster", cluster.getDisplayName()); }
@Test public void getClusterWithInvalidId() { String clusterId = "invalid-id"; expectedEx.expect(EntityNotFoundException.class); expectedEx.expectMessage("Cluster with the specified ID not found: ID = " + clusterId); clusterService.getCluster(clusterId); }