### Question:
BBInputSetup implements JavaDelegate { protected void mapVnfcCollectionInstanceGroup(GenericVnf genericVnf, ModelInfo modelInfo, Service service) { VnfResourceCustomization vnfResourceCustomization = getVnfResourceCustomizationFromService(modelInfo, service); if (vnfResourceCustomization != null) { List<VnfcInstanceGroupCustomization> vnfcInstanceGroups = vnfResourceCustomization.getVnfcInstanceGroupCustomizations(); for (VnfcInstanceGroupCustomization vnfcInstanceGroupCust : vnfcInstanceGroups) { InstanceGroup instanceGroup = this.createInstanceGroup(); org.onap.so.db.catalog.beans.InstanceGroup catalogInstanceGroup = bbInputSetupUtils .getCatalogInstanceGroup(vnfcInstanceGroupCust.getInstanceGroup().getModelUUID()); instanceGroup.setModelInfoInstanceGroup( this.mapperLayer.mapCatalogInstanceGroupToInstanceGroup(null, catalogInstanceGroup)); instanceGroup.getModelInfoInstanceGroup().setFunction(vnfcInstanceGroupCust.getFunction()); instanceGroup.getModelInfoInstanceGroup().setDescription(vnfcInstanceGroupCust.getDescription()); genericVnf.getInstanceGroups().add(instanceGroup); } } }  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 testMapVnfcCollectionInstanceGroup() { VnfResourceCustomization vnfResourceCust = Mockito.mock(VnfResourceCustomization.class); GenericVnf genericVnf = new GenericVnf(); ModelInfo modelInfo = Mockito.mock(ModelInfo.class); Service service = Mockito.mock(Service.class); org.onap.so.db.catalog.beans.InstanceGroup instanceGroup = new org.onap.so.db.catalog.beans.InstanceGroup(); instanceGroup.setModelUUID("modelUUID"); List<VnfcInstanceGroupCustomization> vnfcInstanceGroups = new ArrayList<>(); VnfcInstanceGroupCustomization vnfcInstanceGroupCust = new VnfcInstanceGroupCustomization(); vnfcInstanceGroupCust.setInstanceGroup(instanceGroup); vnfcInstanceGroupCust.setFunction("function"); vnfcInstanceGroupCust.setDescription("description"); vnfcInstanceGroups.add(vnfcInstanceGroupCust); ModelInfoInstanceGroup modelInfoInstanceGroup = new ModelInfoInstanceGroup(); modelInfoInstanceGroup.setModelUUID("modelUUID"); doReturn(vnfResourceCust).when(SPY_bbInputSetup).getVnfResourceCustomizationFromService(modelInfo, service); doReturn(vnfcInstanceGroups).when(vnfResourceCust).getVnfcInstanceGroupCustomizations(); doReturn(instanceGroup).when(SPY_bbInputSetupUtils).getCatalogInstanceGroup("modelUUID"); doReturn(modelInfoInstanceGroup).when(bbInputSetupMapperLayer).mapCatalogInstanceGroupToInstanceGroup(null, instanceGroup); SPY_bbInputSetup.mapVnfcCollectionInstanceGroup(genericVnf, modelInfo, service); assertEquals("Instance Group was created", true, genericVnf.getInstanceGroups().size() == 1); }