@Test public void convertCcDivisions_Same() { long idOne = 111; long idTwo = 222; CommonCourtDivision ccDivisionOne = new CommonCourtDivision(); ccDivisionOne.setName(ccDivisionNames[0]); Whitebox.setInternalState(ccDivisionOne, "id", idOne); CommonCourtDivision ccDivisionTwo = new CommonCourtDivision(); ccDivisionTwo.setName(ccDivisionNames[1]); Whitebox.setInternalState(ccDivisionTwo, "id", idTwo); List<CommonCourtDivision> ccDivisions = Arrays.asList(ccDivisionOne, ccDivisionTwo); List<SimpleEntity> convertedSimpleEntities = simpleEntityConverter.convertCcDivisions(ccDivisions); assertEquals(ccDivisions.size(), convertedSimpleEntities.size()); assertEquals(idOne, convertedSimpleEntities.get(0).getId()); assertEquals(idTwo, convertedSimpleEntities.get(1).getId()); assertEquals(ccDivisionNames[0], convertedSimpleEntities.get(0).getName()); assertEquals(ccDivisionNames[1], convertedSimpleEntities.get(1).getName()); }
public List<SimpleEntity> convertCcDivisions(List<CommonCourtDivision> ccDivisions) { return ccDivisions.stream() .map(ccDivision -> convertFromCcDivision(ccDivision)) .collect(Collectors.toList()); }
SimpleEntityConverter { public List<SimpleEntity> convertCcDivisions(List<CommonCourtDivision> ccDivisions) { return ccDivisions.stream() .map(ccDivision -> convertFromCcDivision(ccDivision)) .collect(Collectors.toList()); } }
SimpleEntityConverter { public List<SimpleEntity> convertCcDivisions(List<CommonCourtDivision> ccDivisions) { return ccDivisions.stream() .map(ccDivision -> convertFromCcDivision(ccDivision)) .collect(Collectors.toList()); }  }
SimpleEntityConverter { public List<SimpleEntity> convertCcDivisions(List<CommonCourtDivision> ccDivisions) { return ccDivisions.stream() .map(ccDivision -> convertFromCcDivision(ccDivision)) .collect(Collectors.toList()); }  List<SimpleEntity> convertCcDivisions(List<CommonCourtDivision> ccDivisions); List<SimpleEntity> convertScChambers(List<SupremeCourtChamber> scChambers); List<SimpleEntity> convertScChamberDivisions(List<SupremeCourtChamberDivision> scChamberDivisions); List<SimpleEntity> convertScJudgmentForms(List<SupremeCourtJudgmentForm> scJudgmentForms); }
SimpleEntityConverter { public List<SimpleEntity> convertCcDivisions(List<CommonCourtDivision> ccDivisions) { return ccDivisions.stream() .map(ccDivision -> convertFromCcDivision(ccDivision)) .collect(Collectors.toList()); }  List<SimpleEntity> convertCcDivisions(List<CommonCourtDivision> ccDivisions); List<SimpleEntity> convertScChambers(List<SupremeCourtChamber> scChambers); List<SimpleEntity> convertScChamberDivisions(List<SupremeCourtChamberDivision> scChamberDivisions); List<SimpleEntity> convertScJudgmentForms(List<SupremeCourtJudgmentForm> scJudgmentForms);  }