final ExtendedDataTransferObject dto = new AnnotatedExtendedDataTransferObjectImpl();
dto.setValue("dtoVal1");
dto.setValue2("dtoVal2");
dto.setTimestamp(time);
final DomainObject entity = new DomainObjectImpl();
final ExtendedDataTransferObject res = (ExtendedDataTransferObject) service.dtoToEntityAndBackToDtoByFilterExact(dto, entity);
assertNotSame(res, dto);
assertNull(entity.getValue());
assertEquals(entity.getValue2(), "dtoVal1");
assertNotNull(entity.getTimestamp());
assertTrue(entity.getTimestamp().after(time));
assertEquals(dto.getValue(), "dtoVal1");
assertEquals(dto.getValue2(), "dtoVal2");
assertEquals(dto.getTimestamp(), time);
assertNull(res.getValue(), "dtoVal1");
assertNull(res.getValue2());
assertEquals(res.getTimestamp(), entity.getTimestamp());
// final check counters
assertCounters(1, 1, 0, 1, 1, 0);
}