@Test public void convertScJudgmentForms_same() { long idOne = 1; long idTwo = 2; SupremeCourtJudgmentForm scJudgmentFormOne = new SupremeCourtJudgmentForm(); scJudgmentFormOne.setName(scJudgmentFormNames[0]); Whitebox.setInternalState(scJudgmentFormOne, "id", idOne); SupremeCourtJudgmentForm scJudgmentFormTwo = new SupremeCourtJudgmentForm(); scJudgmentFormTwo.setName(scJudgmentFormNames[1]); Whitebox.setInternalState(scJudgmentFormTwo, "id", idTwo); List<SupremeCourtJudgmentForm> scJudgmentForms = Arrays.asList(scJudgmentFormOne, scJudgmentFormTwo); List<SimpleEntity> convertedSimpleEntities = simpleEntityConverter.convertScJudgmentForms(scJudgmentForms); assertEquals(scJudgmentForms.size(), convertedSimpleEntities.size()); assertEquals(idOne, convertedSimpleEntities.get(0).getId()); assertEquals(idTwo, convertedSimpleEntities.get(1).getId()); assertEquals(scJudgmentFormNames[0], convertedSimpleEntities.get(0).getName()); assertEquals(scJudgmentFormNames[1], convertedSimpleEntities.get(1).getName()); }
public List<SimpleEntity> convertScJudgmentForms(List<SupremeCourtJudgmentForm> scJudgmentForms) { return scJudgmentForms.stream() .map(scJudgmentForm -> convertFromScJudgmentForm(scJudgmentForm)) .collect(Collectors.toList()); }
SimpleEntityConverter { public List<SimpleEntity> convertScJudgmentForms(List<SupremeCourtJudgmentForm> scJudgmentForms) { return scJudgmentForms.stream() .map(scJudgmentForm -> convertFromScJudgmentForm(scJudgmentForm)) .collect(Collectors.toList()); } }
SimpleEntityConverter { public List<SimpleEntity> convertScJudgmentForms(List<SupremeCourtJudgmentForm> scJudgmentForms) { return scJudgmentForms.stream() .map(scJudgmentForm -> convertFromScJudgmentForm(scJudgmentForm)) .collect(Collectors.toList()); }  }
SimpleEntityConverter { public List<SimpleEntity> convertScJudgmentForms(List<SupremeCourtJudgmentForm> scJudgmentForms) { return scJudgmentForms.stream() .map(scJudgmentForm -> convertFromScJudgmentForm(scJudgmentForm)) .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> convertScJudgmentForms(List<SupremeCourtJudgmentForm> scJudgmentForms) { return scJudgmentForms.stream() .map(scJudgmentForm -> convertFromScJudgmentForm(scJudgmentForm)) .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);  }