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