SubjectTypeResourceConverter extends AbstractConverter<SubjectTypeResource, SubjectType> { @Override public SubjectType convert(final SubjectTypeResource source, final SubjectType target) { target.setName(source.getName()); target.setAbbrName(source.getAbbrName()); return target; }  @Override SubjectType convert(final SubjectTypeResource source, final SubjectType target); @Override SubjectType convert(final SubjectTypeResource source);  }
@Test public void testConvert() throws Exception { String name = "first blood"; String abbrName = "fb"; SubjectType expected = new SubjectType(); expected.setName(name); expected.setAbbrName(abbrName); SubjectTypeResource source = new SubjectTypeResource(); source.setName(name); source.setAbbrName(abbrName); SubjectType actual = unit.convert(source); assertEquals(expected, actual); }