LanguageConverter extends AbstractConverter<Language, LanguageResource> { @Override public LanguageResource convert(final Language source, final LanguageResource target) { target.setAbbrName(source.getAbbrName()); target.setId(source.getId()); target.setName(source.getName()); return target; }  @Override LanguageResource convert(final Language source, final LanguageResource target); @Override LanguageResource convert(final Language source);  }
@Test public void testConvert() throws Exception { Long id = 1L; String name = "name"; String abbrName = "abbr name"; Language source = new Language(); source.setAbbrName(abbrName); source.setName(name); source.setId(id); LanguageResource expected = new LanguageResource(); expected.setAbbrName(abbrName); expected.setId(id); expected.setName(name); LanguageResource actual = unit.convert(source); assertEquals(expected, actual); }