.field("title", "myTitle")
.field("author", "myAuthor")
.byDefault()
.toClassMap());
MapperFacade mapper = factory.getMapperFacade();
// BookChild, AuthorChild, LibraryChild don't directly
// implement Book, Author and Library
Book book = createBook(BookChild.class);
book.setAuthor(createAuthor(AuthorChild.class));
Library lib = createLibrary(LibraryChild.class);
lib.getBooks().add(book);
LibraryMyDTO mappedLib = mapper.map(lib, LibraryMyDTO.class);
Assert.assertEquals(lib.getTitle(), mappedLib.getMyTitle());
Assert.assertEquals(book.getTitle(), mappedLib.getMyBooks().get(0).getMyTitle());
Assert.assertEquals(book.getAuthor().getName(), mappedLib.getMyBooks().get(0).getMyAuthor().getMyName());
}