### Question:
AAIInstanceGroupResources { public void createInstanceGroup(InstanceGroup instanceGroup) { AAIResourceUri instanceGroupUri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().instanceGroup(instanceGroup.getId())); org.onap.aai.domain.yang.InstanceGroup aaiInstanceGroup = aaiObjectMapper.mapInstanceGroup(instanceGroup); injectionHelper.getAaiClient().createIfNotExists(instanceGroupUri, Optional.of(aaiInstanceGroup)); }  void createInstanceGroup(InstanceGroup instanceGroup); void deleteInstanceGroup(InstanceGroup instanceGroup); void connectInstanceGroupToVnf(InstanceGroup instanceGroup, GenericVnf vnf); void connectInstanceGroupToVnf(InstanceGroup instanceGroup, GenericVnf vnf, AAIEdgeLabel aaiLabel); boolean exists(InstanceGroup instanceGroup); void createInstanceGroupandConnectServiceInstance(InstanceGroup instanceGroup,
            ServiceInstance serviceInstance); boolean checkInstanceGroupNameInUse(String instanceGroupName);  }### Answer:
@Test public void createInstanceGroupTest() throws Exception { doReturn(new org.onap.aai.domain.yang.InstanceGroup()).when(MOCK_aaiObjectMapper) .mapInstanceGroup(instanceGroup); aaiInstanceGroupResources.createInstanceGroup(instanceGroup); verify(MOCK_aaiResourcesClient, times(1)).createIfNotExists( eq(AAIUriFactory .createResourceUri(AAIFluentTypeBuilder.network().instanceGroup(instanceGroup.getId()))), isA(Optional.class)); }