PTVViewModelToPTVProgramMapper { public PTVProgram convertToPTVProgram(List<PTVViewModel> viewModels, PTVProgram ptvProgram) { for (PTVProgramStockInformation ptvProgramStockInformation : ptvProgram.getPtvProgramStocksInformation()) { for (ServiceDispensation service : ptvProgramStockInformation.getServiceDispensations()) { putViewModelsAmountsInPTVFields(ptvProgramStockInformation, service, viewModels); } } return ptvProgram; } @Inject  PTVViewModelToPTVProgramMapper(); PTVProgram convertToPTVProgram(List<PTVViewModel> viewModels, PTVProgram ptvProgram);  }
@Test public void shouldFillPtvProgramListsFromViewModelList() { PTVProgram ptvProgram = createPtvProgram(); PTVProgram resultPtvProgram = ptvViewModelToPTVProgramMapper.convertToPTVProgram(ptvViewModels, ptvProgram); assertPtvProgramStockInformationIsCorrectlyMapped(resultPtvProgram); }