### Question:
SimpleCommonCourtConverter { public List<SimpleCommonCourt> convertCommonCourts(List<CommonCourt> commonCourts) { if (CollectionUtils.isEmpty(commonCourts)) { return Lists.newArrayList(); } return commonCourts.stream() .map(commonCourt -> convertFromCommonCourt(commonCourt)) .collect(Collectors.toList()); }  List<SimpleCommonCourt> convertCommonCourts(List<CommonCourt> commonCourts);  }### Answer:
@Test public void convertCommonCourts_emptyList() { List<CommonCourt> commonCourts = Lists.newArrayList(); List<SimpleCommonCourt> convertedSimpleEntities = simpleCommonCourtConverter.convertCommonCourts(commonCourts); assertNotNull(convertedSimpleEntities); assertEquals(0, convertedSimpleEntities.size()); }
@Test public void convertCommonCourts_NULL() { List<SimpleCommonCourt> convertedSimpleEntities = simpleCommonCourtConverter.convertCommonCourts(null); assertNotNull(convertedSimpleEntities); assertEquals(0, convertedSimpleEntities.size()); }
@Test public void convertCommonCourts() { CommonCourt commonCourtOne = new CommonCourt(); commonCourtOne.setName(commonCourtNames[0]); commonCourtOne.setType(CommonCourtType.DISTRICT); Whitebox.setInternalState(commonCourtOne, "id", 83); CommonCourt commonCourtTwo = new CommonCourt(); commonCourtTwo.setName(commonCourtNames[1]); commonCourtTwo.setType(CommonCourtType.APPEAL); Whitebox.setInternalState(commonCourtTwo, "id", 257); List<CommonCourt> commonCourts = Lists.newArrayList(commonCourtOne, commonCourtTwo); List<SimpleCommonCourt> convertedSimpleEntities = simpleCommonCourtConverter.convertCommonCourts(commonCourts); assertEquals(commonCourts.size(), convertedSimpleEntities.size()); assertEquals(83, convertedSimpleEntities.get(0).getId()); assertEquals(commonCourtNames[0], convertedSimpleEntities.get(0).getName()); assertEquals(CommonCourtType.DISTRICT, convertedSimpleEntities.get(0).getType()); assertEquals(257, convertedSimpleEntities.get(1).getId()); assertEquals(commonCourtNames[1], convertedSimpleEntities.get(1).getName()); assertEquals(CommonCourtType.APPEAL, convertedSimpleEntities.get(1).getType()); }