### Question:
BBInputSetup implements JavaDelegate { protected Customer getCustomerAndServiceSubscription(RequestDetails requestDetails, String resourceId) { Customer customer; if (requestDetails.getSubscriberInfo() != null) { customer = this.getCustomerFromRequest(requestDetails); } else { customer = this.getCustomerFromURI(resourceId); } if (customer != null) { ServiceSubscription serviceSubscription = null; serviceSubscription = getServiceSubscription(requestDetails, customer); if (serviceSubscription == null) { serviceSubscription = getServiceSubscriptionFromURI(resourceId, customer); } customer.setServiceSubscription(serviceSubscription); return customer; } else { return null; } }  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 testGetCustomerAndServiceSubscription() throws JsonParseException, JsonMappingException, IOException { RequestDetails requestDetails = mapper.readValue( new File(RESOURCE_PATH + "RequestDetailsInput_withRelatedInstanceList.json"), RequestDetails.class); SubscriberInfo subscriberInfo = new SubscriberInfo(); subscriberInfo.setGlobalSubscriberId("globalSubscriberId"); RequestParameters requestParams = new RequestParameters(); requestParams.setSubscriptionServiceType("subscriptionServiceType"); requestDetails.setRequestParameters(requestParams); requestDetails.setSubscriberInfo(subscriberInfo); String resourceId = "resourceId"; Customer expected = new Customer(); expected.setGlobalCustomerId("globalCustomerId"); ServiceSubscription serviceSubscription = new ServiceSubscription(); serviceSubscription.setServiceType("subscriptionServiceType"); doReturn(expected).when(this.SPY_bbInputSetup).getCustomerFromRequest(requestDetails); doReturn(serviceSubscription).when(this.SPY_bbInputSetup).getServiceSubscription(requestDetails, expected); Customer actual = this.SPY_bbInputSetup.getCustomerAndServiceSubscription(requestDetails, resourceId); assertThat(actual, sameBeanAs(expected)); requestDetails.setSubscriberInfo(null); assertThat(actual, sameBeanAs(expected)); }