### Question:
BBInputSetupPnf { static void populatePnfToServiceInstance(Pnfs pnfs, String pnfId, ServiceInstance serviceInstance) { removePnfFromServiceIfExists(serviceInstance, pnfId); Pnf pnf = new Pnf(); pnf.setPnfId(pnfId); pnf.setPnfName(pnfs.getInstanceName()); pnf.setModelInfoPnf(new ModelInfoPnf()); pnf.getModelInfoPnf().setModelCustomizationUuid(pnfs.getModelInfo().getModelCustomizationId()); pnf.getModelInfoPnf().setModelInvariantUuid(pnfs.getModelInfo().getModelInvariantId()); pnf.getModelInfoPnf().setModelUuid(pnfs.getModelInfo().getModelVersionId()); pnf.setOrchestrationStatus(OrchestrationStatus.PRECREATED); serviceInstance.getPnfs().add(pnf); } private  BBInputSetupPnf();   }### Answer:
@Test public void populatePnfShouldSetRequiredFields() { final String pnfId = "PNF_id1"; final String pnfName = "PNF_name1"; final String modelCustomizationId = "8421fe03-fd1b-4bf7-845a-c3fe91edb031"; final String modelInvariantId = "3360a2a5-22ff-44c7-8935-08c8e5ecbd06"; final String modelVersionId = "b80c3a52-abd4-436c-a22e-9c5da768781a"; doReturn(modelCustomizationId).when(modelInfo).getModelCustomizationId(); doReturn(modelInvariantId).when(modelInfo).getModelInvariantId(); doReturn(modelVersionId).when(modelInfo).getModelVersionId(); doReturn(pnfName).when(pnfs).getInstanceName(); doReturn(modelInfo).when(pnfs).getModelInfo(); ServiceInstance serviceInstance = new ServiceInstance(); BBInputSetupPnf.populatePnfToServiceInstance(pnfs, pnfId, serviceInstance); assertEquals(1, serviceInstance.getPnfs().size()); Pnf pnf = serviceInstance.getPnfs().get(0); assertEquals(pnfId, pnf.getPnfId()); assertEquals(pnfName, pnf.getPnfName()); assertEquals(modelCustomizationId, pnf.getModelInfoPnf().getModelCustomizationUuid()); assertEquals(modelInvariantId, pnf.getModelInfoPnf().getModelInvariantUuid()); assertEquals(modelVersionId, pnf.getModelInfoPnf().getModelUuid()); assertEquals(OrchestrationStatus.PRECREATED, pnf.getOrchestrationStatus()); }