### Question:
AAIServiceInstanceResources { public boolean checkInstanceServiceNameInUse(ServiceInstance serviceInstance) { AAIPluralResourceUri uriSI = AAIUriFactory.createNodesUri(Types.SERVICE_INSTANCES.getFragment()) .queryParam("service-instance-name", serviceInstance.getServiceInstanceName()); return injectionHelper.getAaiClient().exists(uriSI); }  boolean existsServiceInstance(ServiceInstance serviceInstance); void createServiceInstance(ServiceInstance serviceInstance, Customer customer); void createServiceSubscription(Customer customer); void deleteServiceInstance(ServiceInstance serviceInstance); void createProject(Project project); void createProjectandConnectServiceInstance(Project project, ServiceInstance serviceInstance); void createOwningEntity(OwningEntity owningEntity); boolean existsOwningEntity(OwningEntity owningEntity); boolean existsOwningEntityName(String owningEntityName); org.onap.aai.domain.yang.OwningEntity getOwningEntityByName(String owningEntityName); void connectOwningEntityandServiceInstance(OwningEntity owningEntity, ServiceInstance serviceInstance); void createOwningEntityandConnectServiceInstance(OwningEntity owningEntity,
            ServiceInstance serviceInstance); void updateOrchestrationStatusServiceInstance(ServiceInstance serviceInstance,
            OrchestrationStatus orchestrationStatus); void updateServiceInstance(ServiceInstance serviceInstance); boolean checkInstanceServiceNameInUse(ServiceInstance serviceInstance);  }### Answer:
@Test public void checkInstanceServiceNameInUseTrueTest() throws Exception { AAIPluralResourceUri uri = AAIUriFactory.createNodesUri(Types.SERVICE_INSTANCES.getFragment()) .queryParam("service-instance-name", serviceInstance.getServiceInstanceName()); doReturn(true).when(MOCK_aaiResourcesClient).exists(eq(uri)); boolean nameInUse = aaiServiceInstanceResources.checkInstanceServiceNameInUse(serviceInstance); assertTrue(nameInUse); }
@Test public void checkInstanceServiceNameInUseFalseTest() throws Exception { AAIPluralResourceUri uri = AAIUriFactory.createNodesUri(Types.SERVICE_INSTANCES.getFragment()) .queryParam("service-instance-name", serviceInstance.getServiceInstanceName()); doReturn(false).when(MOCK_aaiResourcesClient).exists(eq(uri)); boolean nameInUse = aaiServiceInstanceResources.checkInstanceServiceNameInUse(serviceInstance); assertFalse(nameInUse); }