### Question:
BBInputSetup implements JavaDelegate { protected void mapOwningEntity(List<AAIResultWrapper> owningEntities, ServiceInstance serviceInstance) { if (!owningEntities.isEmpty()) { AAIResultWrapper owningEntityWrapper = owningEntities.get(0); Optional<org.onap.aai.domain.yang.OwningEntity> aaiOwningEntityOp = owningEntityWrapper.asBean(org.onap.aai.domain.yang.OwningEntity.class); if (aaiOwningEntityOp.isPresent()) { OwningEntity owningEntity = this.mapperLayer.mapAAIOwningEntity(aaiOwningEntityOp.get()); serviceInstance.setOwningEntity(owningEntity); } } }  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 testMapOwningEntity() throws JsonProcessingException { org.onap.aai.domain.yang.OwningEntity expectedAAI = new org.onap.aai.domain.yang.OwningEntity(); OwningEntity expected = new OwningEntity(); AAIResultWrapper vnfWrapper = new AAIResultWrapper(new AAICommonObjectMapperProvider().getMapper().writeValueAsString(expectedAAI)); doReturn(expected).when(bbInputSetupMapperLayer) .mapAAIOwningEntity(isA(org.onap.aai.domain.yang.OwningEntity.class)); ServiceInstance serviceInstance = new ServiceInstance(); SPY_bbInputSetup.mapOwningEntity(Arrays.asList(new AAIResultWrapper[] {vnfWrapper}), serviceInstance); assertEquals(expected, serviceInstance.getOwningEntity()); }