### Question:
TrajectoryDomain implements DiscretePointDomain<GeoPosition> { @Override public boolean contains(GeoPosition position) { if (position == null) { return false; } Iterator<GeoPosition> iterator = positions.iterator(); while (iterator.hasNext()) { if (position.equals(iterator.next())) { return true; } } return false; } TrajectoryDomain(List<GeoPosition> positions); VerticalCrs getVerticalCrs(); CoordinateReferenceSystem getHorizontalCrs(); Chronology getChronology(); BoundingBox getCoordinateBounds(); Extent<DateTime> getTimeExtent(); Extent<Double> getVerticalExtent(); int size(); @Override Array1D<GeoPosition> getDomainObjects(); @Override boolean contains(GeoPosition position); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testContains() { HorizontalPosition hPos = new HorizontalPosition(11.0, 22.0, crs); VerticalPosition vPos = new VerticalPosition(200.0, height); DateTime dt = beginDate.plusDays(10); assertTrue(tDomain.contains(new GeoPosition(hPos, vPos, dt))); dt = beginDate.plusDays(11); assertFalse(tDomain.contains(new GeoPosition(hPos, vPos, dt))); assertFalse(tDomain.contains(null)); hPos = new HorizontalPosition(10.0, 20.0, crs); vPos = new VerticalPosition(100.0, height); assertTrue(tDomain.contains(new GeoPosition(hPos, vPos, beginDate))); hPos = new HorizontalPosition(19.9, 39.8, crs); dt = beginDate.plusDays(99); vPos = new VerticalPosition(1090.0, height); assertTrue(tDomain.contains(new GeoPosition(hPos, vPos, dt))); }