### Question:
BBInputSetup implements JavaDelegate { protected void populateL3Network(BBInputSetupParameter parameter) { L3Network network = null; for (L3Network networkTemp : parameter.getServiceInstance().getNetworks()) { if (parameter.getLookupKeyMap().get(ResourceKey.NETWORK_ID) != null && networkTemp.getNetworkId() .equalsIgnoreCase(parameter.getLookupKeyMap().get(ResourceKey.NETWORK_ID))) { network = networkTemp; break; } } if (network == null && (parameter.getBbName().equalsIgnoreCase(AssignFlows.NETWORK_A_LA_CARTE.toString()) || parameter.getBbName().equalsIgnoreCase(AssignFlows.NETWORK_MACRO.toString()))) { network = createNetwork(parameter.getLookupKeyMap(), parameter.getInstanceName(), parameter.getResourceId(), parameter.getInstanceParams(), parameter); parameter.getServiceInstance().getNetworks().add(network); } if (network != null) { mapCatalogNetwork(network, parameter.getModelInfo(), parameter.getService()); } }  BBInputSetupUtils getBbInputSetupUtils(); void setCloudInfoFromAAI(CloudInfoFromAAI cloudInfoFromAAI); void setBbInputSetupUtils(BBInputSetupUtils bbInputSetupUtils); BBInputSetupMapperLayer getMapperLayer(); void setMapperLayer(BBInputSetupMapperLayer mapperLayer); @Override void execute(DelegateExecution execution); ServiceInstance getExistingServiceInstance(org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI);  }### Answer:
@Test public void testPopulateL3Network() throws JsonParseException, JsonMappingException, IOException { String instanceName = "networkName"; ModelInfo modelInfo = new ModelInfo(); modelInfo.setModelType(ModelType.network); ServiceInstance serviceInstance = new ServiceInstance(); L3Network network = new L3Network(); network.setNetworkId("networkId"); network.setNetworkName("networkName"); serviceInstance.getNetworks().add(network); String resourceId = "123"; Service service = mapper.readValue( new File(RESOURCE_PATH + "CatalogDBService_getServiceInstanceNOAAIInput.json"), Service.class); Map<ResourceKey, String> lookupKeyMap = new HashMap<>(); lookupKeyMap.put(ResourceKey.NETWORK_ID, "networkId"); String bbName = AssignFlows.NETWORK_A_LA_CARTE.toString(); doNothing().when(SPY_bbInputSetup).mapCatalogNetwork(network, modelInfo, service); BBInputSetupParameter parameter = new BBInputSetupParameter.Builder().setRequestId(REQUEST_ID) .setInstanceName(instanceName).setModelInfo(modelInfo).setService(service).setBbName(bbName) .setServiceInstance(serviceInstance).setLookupKeyMap(lookupKeyMap).setResourceId(resourceId).build(); SPY_bbInputSetup.populateL3Network(parameter); lookupKeyMap.put(ResourceKey.NETWORK_ID, null); SPY_bbInputSetup.populateL3Network(parameter); verify(SPY_bbInputSetup, times(1)).mapCatalogNetwork(network, modelInfo, service); instanceName = "networkName2"; L3Network network2 = SPY_bbInputSetup.createNetwork(lookupKeyMap, instanceName, resourceId, null, parameter); SPY_bbInputSetup.populateL3Network(parameter); verify(SPY_bbInputSetup, times(2)).mapCatalogNetwork(network2, modelInfo, service); }