### Question:
ObservationFinder { public void findObservations(List<SamplingPoint> samples, Parameter parameter, boolean primarySensor) { final long searchTimePastMillis = parameter.getSearchTimePast() * 1000; final long searchTimeFutureMillis = parameter.getSearchTimeFuture() * 1000; final Date startDate = new Date(parameter.getStartTime() - searchTimePastMillis); final Date stopDate = new Date(parameter.getStopTime() + searchTimeFutureMillis); final String orbitSensorName = SensorNames.getOrbitName(parameter.getSensorName()); final Storage storage = persistenceManager.getStorage(); final List<RelatedObservation> orbitObservations = storage.getRelatedObservations(orbitSensorName, startDate, stopDate); final PolarOrbitingPolygon[] polygons = new PolarOrbitingPolygon[orbitObservations.size()]; for (int i = 0; i < orbitObservations.size(); ++i) { final RelatedObservation orbitObservation = orbitObservations.get(i); polygons[i] = new PolarOrbitingPolygon(orbitObservation.getId(), orbitObservation.getTime().getTime(), orbitObservation.getLocation().getGeometry()); } findObservations(samples, searchTimePastMillis, searchTimeFutureMillis, primarySensor, polygons); } ObservationFinder(PersistenceManager persistenceManager); void findPrimarySensorObservations(List<SamplingPoint> samples, Parameter parameter); void findSecondarySensorObservations(List<SamplingPoint> samples, Parameter parameter); void findObservations(List<SamplingPoint> samples, Parameter parameter, boolean primarySensor);  }### Answer:
@Test public void testFindDualSensorMatchups() throws ParseException { final long startTime = TimeUtil.parseCcsdsUtcFormat("2003-01-01T00:00:00Z").getTime(); final long stopTime = TimeUtil.parseCcsdsUtcFormat("2003-01-02T00:00:00Z").getTime(); final List<SamplingPoint> samples = new SobolSamplePointGenerator().createSamples(10000, 0, startTime, stopTime); assertEquals(10000, samples.size()); final PolarOrbitingPolygon orbitPolygonAatsr = createAtsrPolygon(1); final int seventeenDaysTwelveHoursInMillisHalf = 86400 * 175 / 20 * 1000; ObservationFinder.findObservations(samples, seventeenDaysTwelveHoursInMillisHalf, seventeenDaysTwelveHoursInMillisHalf, true, orbitPolygonAatsr); assertEquals(518, samples.size()); final PolarOrbitingPolygon orbitPolygonAtsr2 = createAtsr2Polygon(); final int twelfAndAHalfHour = 90000 * 500; ObservationFinder.findObservations(samples, twelfAndAHalfHour, twelfAndAHalfHour, false, orbitPolygonAtsr2); assertEquals(471, samples.size()); }
@Test public void testFindObservations_withNoPolygon() throws Exception { final List<SamplingPoint> samples = new ArrayList<>(); samples.add(new SamplingPoint()); final int seventeenDaysTwelveHoursInMillisHalf = 86400 * 175 / 10 * 1000; ObservationFinder.findObservations(samples, seventeenDaysTwelveHoursInMillisHalf, seventeenDaysTwelveHoursInMillisHalf, true); assertTrue(samples.isEmpty()); }