@Test public void testCustomConverter() {

  Converter<UserDto, User> converter = new Converter<>(
      userDto -> new User(userDto.getFirstName(), userDto.getLastName(), userDto.isActive(),
      String.valueOf(new Random().nextInt())),
      user -> new UserDto(user.getFirstName(), user.getLastName(), user.isActive(),
      user.getFirstName().toLowerCase() + user.getLastName().toLowerCase() + "@whatever.com"));
  User u1 = new User("John", "Doe", false, "12324");
  UserDto userDto = converter.convertFromEntity(u1);
  assertEquals(userDto.getEmail(), "johndoe@whatever.com");
}