OutboundDocQueryAggregator implements NhinAggregator { protected void aggregateRegistryObjectList(AdhocQueryResponse aggregatedResponse, AdhocQueryResponse individualResponse) { RegistryObjectListType registryObjectList = individualResponse.getRegistryObjectList(); if (registryObjectList != null) { collectRegistryObjectResponses(aggregatedResponse, registryObjectList); } }  void increaseCount(AdhocQueryResponse aggregate); void aggregate(OutboundDocQueryOrchestratable to, OutboundDocQueryOrchestratable from); @Override void aggregate(OutboundOrchestratable to, OutboundOrchestratable from);  }
@Test public void testAggregateRegistryCollectionNullRegistry() { AdhocQueryResponse aggregatedResponse = new AdhocQueryResponse(); aggregatedResponse.setRegistryObjectList(new RegistryObjectListType()); AdhocQueryResponse individualResponse = new AdhocQueryResponse(); nhinAggregator.aggregateRegistryObjectList(aggregatedResponse, individualResponse); assertNotNull(aggregatedResponse.getRegistryObjectList()); assertEquals(0, aggregatedResponse.getRegistryObjectList().getIdentifiable().size()); }
@Test public void testAggregateRegistryCollection() { AdhocQueryResponse aggregatedResponse = new AdhocQueryResponse(); AdhocQueryResponse individualResponse = new AdhocQueryResponse(); aggregatedResponse.setRegistryObjectList(new RegistryObjectListType()); individualResponse.setRegistryObjectList(createRegistryObjectListType(new RegistryObjectType())); nhinAggregator.aggregateRegistryObjectList(aggregatedResponse, individualResponse); assertEquals(1, aggregatedResponse.getRegistryObjectList().getIdentifiable().size()); }