ServiceDependencyBuilder { public static InvocationMetric getMergedMetrics(java.util.List<InvocationDefinition> invocations) { InvocationMetric ret=new InvocationMetric(); for (InvocationDefinition id : invocations) { ret.merge(id.getMetrics()); } return (ret); } private  ServiceDependencyBuilder(); static java.util.Set<ServiceDefinition> getInitialServices(java.util.Collection<ServiceDefinition> sds); static java.util.Set<ServiceDefinition> getServiceClients(ServiceDefinition mainsd,
                        java.util.Collection<ServiceDefinition> sds); static ServiceGraph buildGraph(java.util.Set<ServiceDefinition> sds,
                        java.util.List<Situation> sits, String focusServiceType); static ServiceGraph buildGraph(java.util.Set<ServiceDefinition> sds,
                        java.util.List<Situation> sits); static InvocationMetric getMergedMetrics(java.util.List<InvocationDefinition> invocations);  }
@Test public void testMergedMetrics() { InvocationDefinition id1=new InvocationDefinition(); InvocationDefinition id2=new InvocationDefinition(); InvocationMetric im1=id1.getMetrics(); im1.setCount(1); InvocationMetric im2=id2.getMetrics(); im2.setCount(2); java.util.List<InvocationDefinition> ids=new java.util.ArrayList<InvocationDefinition>(); ids.add(id1); ids.add(id2); InvocationMetric imresult=ServiceDependencyBuilder.getMergedMetrics(ids); if (imresult == null) { fail("No merged metric returned"); } if (imresult.getCount() != 3) { fail("Expecting count of 3: "+imresult.getCount()); } }