### Question:
AAIObjectInstanceNameGenerator { public String generateInstanceGroupName(InstanceGroup instanceGroup, GenericVnf vnf) { if (vnf.getVnfName() != null && instanceGroup.getModelInfoInstanceGroup().getFunction() != null) { return vnf.getVnfName() + "_" + instanceGroup.getModelInfoInstanceGroup().getFunction(); } else { throw new IllegalArgumentException( "Cannot generate instance group name because either one or both fields are null: " + " Vnf Instance Name: " + vnf.getVnfName() + ", Instance Group Function: " + instanceGroup.getModelInfoInstanceGroup().getFunction()); } }  String generateInstanceGroupName(InstanceGroup instanceGroup, GenericVnf vnf);  }### Answer:
@Test public void generateInstanceGroupNameTest() throws Exception { ModelInfoInstanceGroup modelVnfc = new ModelInfoInstanceGroup(); modelVnfc.setFunction("vre"); modelVnfc.setType("VNFC"); InstanceGroup instanceGroup = new InstanceGroup(); instanceGroup.setId("test-001"); instanceGroup.setModelInfoInstanceGroup(modelVnfc); GenericVnf vnf = new GenericVnf(); vnf.setVnfId("vnf-123"); vnf.setVnfName("test-vnf"); assertEquals("test-vnf_vre", new AAIObjectInstanceNameGenerator().generateInstanceGroupName(instanceGroup, vnf)); }