OutboundDocQueryAggregator implements NhinAggregator { protected void collectRegistryObjectResponses(AdhocQueryResponse aggregatedResponse, RegistryObjectListType singleRegistryObjectList) { RegistryObjectListType registryObjectList = aggregatedResponse.getRegistryObjectList(); registryObjectList.getIdentifiable().addAll(singleRegistryObjectList.getIdentifiable()); }  void increaseCount(AdhocQueryResponse aggregate); void aggregate(OutboundDocQueryOrchestratable to, OutboundDocQueryOrchestratable from); @Override void aggregate(OutboundOrchestratable to, OutboundOrchestratable from);  }
@Test public void testRegistryCollectionSingle() { AdhocQueryResponse aggregatedResponse = new AdhocQueryResponse(); aggregatedResponse.setRegistryObjectList(new RegistryObjectListType()); nhinAggregator.collectRegistryObjectResponses(aggregatedResponse, createRegistryObjectListType(new RegistryObjectType())); assertEquals(1, aggregatedResponse.getRegistryObjectList().getIdentifiable().size()); }
@Test public void testRegistryCollectionSingleMultiple() { AdhocQueryResponse aggregatedResponse = new AdhocQueryResponse(); aggregatedResponse.setRegistryObjectList(new RegistryObjectListType()); nhinAggregator.collectRegistryObjectResponses(aggregatedResponse, createRegistryObjectListType(new RegistryObjectType())); nhinAggregator.collectRegistryObjectResponses(aggregatedResponse, createRegistryObjectListType(new RegistryObjectType())); nhinAggregator.collectRegistryObjectResponses(aggregatedResponse, createRegistryObjectListType(new RegistryObjectType())); nhinAggregator.collectRegistryObjectResponses(aggregatedResponse, createRegistryObjectListType(new RegistryObjectType())); assertEquals(4, aggregatedResponse.getRegistryObjectList().getIdentifiable().size()); }