### Question:
JooqPlayerDAO extends AbstractJooqDAO implements PlayerDAO { @Override public Optional<Player> findWithUsername(String username) { Preconditions.checkNotNull(username, "username"); LOGGER.debug("Finding player with username {}", username); Record record = context().select().from(PLAYER).where(PLAYER.USERNAME.eq(username)).fetchOne(); if (record == null) { return Optional.empty(); } return Optional.of(PlayerMapper.fromRecord(record)); } @Inject  JooqPlayerDAO(UnitOfWorkService unitOfWorkService); @Override void insert(Player player); @Override List<Player> findAll(); @Override Optional<Player> findWithUsername(String username);  }### Answer:
@Test public void testFindWithUsername() throws Exception { Optional<Player> player = sut.findWithUsername(BasicScenario.Player1.PLAYER.getUsername()); assertThat(player.isPresent(), is(true)); assertThat(player.get(), is(BasicScenario.Player1.PLAYER)); }
@Test public void testFindWithUsername2() throws Exception { Optional<Player> player = sut.findWithUsername("dummy"); assertThat(player.isPresent(), is(false)); }