### Question:
JooqFlightDAO extends AbstractJooqDAO implements FlightDAO { @Override public List<Flight> findWithTypeAndDetected(FlightType type, boolean detected) { Preconditions.checkNotNull(type, "type"); LOGGER.debug("Finding flights with type {} and detection status {}", type, detected); Result<Record> result = context().select().from(FLIGHT).join(FLIGHT_SHIPS).on(FLIGHT_SHIPS.FLIGHT_ID.eq(FLIGHT.ID)) .where(FLIGHT.TYPE.eq(type.getId())) .and(FLIGHT.DETECTED.eq(detected)) .fetch(); return readFlights(result); } @Inject  JooqFlightDAO(UnitOfWorkService unitOfWorkService); @Override void insert(Flight flight); @Override List<Flight> findWithPlayerId(UUID playerId); @Override List<Flight> findWithArrival(long arrival); @Override void update(Flight flight); @Override void delete(Flight flight); @Override List<Flight> findWithTypeAndDetected(FlightType type, boolean detected); @Override List<Flight> findWithStart(Location location);  }### Answer:
@Test public void testFindWithTypeAndDetected() throws Exception { Flight expected = FlightScenario.Player1.FLIGHT_1; List<Flight> flights = sut.findWithTypeAndDetected(expected.getType(), expected.isDetected()); assertThat(flights, hasSize(1)); assertThat(flights.get(0), is(expected)); }
@Test public void testFindWithTypeAndDetected2() throws Exception { List<Flight> flights = sut.findWithTypeAndDetected(FlightType.COLONIZE, false); assertThat(flights, hasSize(0)); }