### Question:
SimpleGridDomain implements GridDomain { @Override public boolean contains(GeoPosition position) { boolean hContains; boolean vContains; boolean tContains; if (position == null) { return false; } if (hGrid == null) { if (position.getHorizontalPosition() != null) { return false; } else { hContains = true; } } else { if (position.getHorizontalPosition() == null) { return false; } else { hContains = hGrid.contains(position.getHorizontalPosition()); } } if (vAxis == null) { if (position.getVerticalPosition() != null) { return false; } else { vContains = true; } } else { if (position.getVerticalPosition() == null) { return false; } else { if (!position.getVerticalPosition().getCoordinateReferenceSystem() .equals(vAxis.getVerticalCrs())) { return false; } vContains = vAxis.contains(position.getVerticalPosition().getZ()); } } if (tAxis == null) { if (position.getTime() != null) { return false; } else { tContains = true; } } else { if (position.getTime() == null) { return false; } else { tContains = tAxis.contains(position.getTime()); } } return hContains && vContains && tContains; } SimpleGridDomain(HorizontalGrid hGrid, VerticalAxis vAxis, TimeAxis tAxis); @Override Array<GridCell4D> getDomainObjects(); @Override boolean contains(GeoPosition position); @Override HorizontalGrid getHorizontalGrid(); @Override VerticalAxis getVerticalAxis(); @Override TimeAxis getTimeAxis(); @Override long size();  }### Answer:
@Test public void testContains() { assertFalse(sgd.contains(null)); HorizontalPosition hPosition = new HorizontalPosition(65.0, 44.0, crs); VerticalPosition vPosition = new VerticalPosition(1000.0, height); GeoPosition gPosition = new GeoPosition(hPosition, vPosition, start); assertTrue(sgd.contains(gPosition)); vPosition = new VerticalPosition(950.0, height); gPosition = new GeoPosition(hPosition, vPosition, start); assertFalse(sgd.contains(gPosition)); hPosition = new HorizontalPosition(65.0, 60.0, crs); vPosition = new VerticalPosition(1100.0, height); gPosition = new GeoPosition(hPosition, vPosition, start); assertTrue(sgd.contains(gPosition)); hPosition = new HorizontalPosition(76.0, 44.0, crs); vPosition = new VerticalPosition(1300.0, height); gPosition = new GeoPosition(hPosition, vPosition, start.plusDays(10)); assertTrue(sgd.contains(gPosition)); hPosition = new HorizontalPosition(76.0, 60.0, crs); vPosition = new VerticalPosition(1700.0, height); gPosition = new GeoPosition(hPosition, vPosition, start.plusDays(15)); assertTrue(sgd.contains(gPosition)); vPosition = new VerticalPosition(2000.0, height); gPosition = new GeoPosition(hPosition, vPosition, start.plusDays(20)); assertTrue(sgd.contains(gPosition)); gPosition = new GeoPosition(hPosition, vPosition, start.plusDays(21)); assertFalse(sgd.contains(gPosition)); gPosition = new GeoPosition(hPosition, vPosition, start.plusDays(30)); assertFalse(sgd.contains(gPosition)); }