### Question:
BBInputSetup implements JavaDelegate { protected void populateInstanceGroup(BBInputSetupParameter parameter) { InstanceGroup instanceGroup = new InstanceGroup(); instanceGroup.setId(parameter.getInstanceGroupId()); instanceGroup.setInstanceGroupName(parameter.getInstanceName()); mapCatalogInstanceGroup(instanceGroup, parameter.getModelInfo(), parameter.getService()); parameter.getServiceInstance().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 testPopulateInstanceGroup() throws Exception { ModelInfo modelInfo = Mockito.mock(ModelInfo.class); Service service = Mockito.mock(Service.class); List<InstanceGroup> instanceGroups = Mockito.spy(new ArrayList<>()); ServiceInstance serviceInstance = Mockito.spy(new ServiceInstance()); serviceInstance.setServiceInstanceId("si-001"); serviceInstance.setServiceInstanceName("test service instance"); serviceInstance.setInstanceGroups(instanceGroups); BBInputSetupParameter parameter = new BBInputSetupParameter.Builder().setModelInfo(modelInfo) .setService(service).setServiceInstance(serviceInstance).setResourceId("instance-group-001") .setInstanceName("test instance group").build(); SPY_bbInputSetup.populateInstanceGroup(parameter); verify(SPY_bbInputSetup, times(1)).mapCatalogInstanceGroup(isA(InstanceGroup.class), isA(ModelInfo.class), isA(Service.class)); verify(instanceGroups, times(1)).add(isA(InstanceGroup.class)); }