### Question:
JooqPlanetDAO extends AbstractJooqDAO implements PlanetDAO { @Override public Optional<Planet> findWithLocation(Location location) { Preconditions.checkNotNull(location, "location"); LOGGER.debug("Finding planet with location {}", location); Record record = context().select().from(PLANET).where( PLANET.LOCATION_GALAXY.eq(location.getGalaxy()) .and(PLANET.LOCATION_SOLAR_SYSTEM.eq(location.getSolarSystem()) .and(PLANET.LOCATION_PLANET.eq(location.getPlanet())) )).fetchOne(); if (record == null) { return Optional.empty(); } return Optional.of(PlanetMapper.fromRecord(record)); } @Inject  JooqPlanetDAO(UnitOfWorkService unitOfWorkService); @Override void insert(Planet planet); @Override List<Planet> findWithOwnerId(UUID ownerId); @Override Optional<Planet> findWithLocation(Location location); @Override void update(Planet planet); @Override List<Planet> findAll(); @Override Optional<Planet> findWithId(UUID id); @Override List<PlanetWithOwner> findInRange(int galaxyMin, int galaxyMax, int solarSystemMin, int solarSystemMax, int planetMin, int planetMax);  }### Answer:
@Test public void testFindWithLocation() throws Exception { Optional<Planet> planet = sut.findWithLocation(BasicScenario.Player1.Planet1.PLANET.getLocation()); assertThat(planet.isPresent(), is(true)); assertThat(planet.get(), is(BasicScenario.Player1.Planet1.PLANET)); }
@Test public void testFindWithLocation2() throws Exception { Optional<Planet> planet = sut.findWithLocation(new Location(1, 1, 1)); assertThat(planet.isPresent(), is(false)); }