### Question:
SourceCommonCourtConverter { public CommonCourt convert(XmlCommonCourt xmlCourt) { Preconditions.checkNotNull(xmlCourt); Preconditions.checkArgument(CommonCourtUtils.isValidCommonCourtCode(xmlCourt.getId())); CommonCourt court = new CommonCourt(); court.setCode(xmlCourt.getId()); court.setName(xmlCourt.getName()); court.setType(CommonCourtUtils.extractType(court.getCode())); convertDivisions(xmlCourt, court); return court; }  CommonCourt convert(XmlCommonCourt xmlCourt); @Autowired void setCcDivisionTypeRepository(CcDivisionTypeRepository ccDivisionTypeRepository);  }### Answer:
@Test public void convert() { CommonCourt commonCourt = commonCourtConverter.convert(xmlCourt); assertCourt(xmlCourt, commonCourt); }
@Test(expected=IllegalArgumentException.class) public void convert_INVALID_COURT_CODE() { xmlCourt.setId("asas22"); commonCourtConverter.convert(xmlCourt); }