### Question:
BBInputSetup implements JavaDelegate { protected Optional<String> getVolumeGroupIdRelatedToVfModule(GenericVnf vnf, ModelInfo modelInfo, String cloudOwner, String cloudRegionId, Map<ResourceKey, String> lookupKeyMap) { if (lookupKeyMap.get(ResourceKey.VOLUME_GROUP_ID) == null) { for (VolumeGroup volumeGroup : vnf.getVolumeGroups()) { String volumeGroupCustId = bbInputSetupUtils.getAAIVolumeGroup(cloudOwner, cloudRegionId, volumeGroup.getVolumeGroupId()) .getModelCustomizationId(); if (modelInfo.getModelCustomizationId().equalsIgnoreCase(volumeGroupCustId)) { logger.debug("Found volume group for vfModule: " + volumeGroup.getVolumeGroupId()); return Optional.of(volumeGroup.getVolumeGroupId()); } } } return Optional.empty(); }  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 testGetVolumeGroupIdRelatedToVfModule() { String expected = "volumeGroupId"; String modelCustomizationId = "modelCustomizationId"; ModelInfo modelInfo = new ModelInfo(); modelInfo.setModelCustomizationId(modelCustomizationId); String cloudOwner = "cloudOwner"; String cloudRegionId = "cloudRegionId"; String volumeGroupId = "volumeGroupId"; GenericVnf vnf = new GenericVnf(); VolumeGroup volumeGroup = new VolumeGroup(); volumeGroup.setVolumeGroupId(expected); vnf.getVolumeGroups().add(volumeGroup); Map<ResourceKey, String> lookupKeyMap = new HashMap<>(); lookupKeyMap.put(ResourceKey.VOLUME_GROUP_ID, null); org.onap.aai.domain.yang.VolumeGroup aaiVolumeGroup = new org.onap.aai.domain.yang.VolumeGroup(); aaiVolumeGroup.setModelCustomizationId(modelCustomizationId); doReturn(aaiVolumeGroup).when(SPY_bbInputSetupUtils).getAAIVolumeGroup(cloudOwner, cloudRegionId, volumeGroupId); Optional<String> actual = SPY_bbInputSetup.getVolumeGroupIdRelatedToVfModule(vnf, modelInfo, cloudOwner, cloudRegionId, lookupKeyMap); assertEquals(expected, actual.get()); }