### Question:
RectilinearGridImpl extends AbstractHorizontalGrid implements RectilinearGrid, Serializable { @Override public boolean contains(HorizontalPosition position) { if (position == null) return false; if (GISUtils.crsMatch(crs, position.getCoordinateReferenceSystem())) { return xAxis.contains(position.getX()) && yAxis.contains(position.getY()); } else { HorizontalPosition transformedPos = GISUtils.transformPosition(position, crs); return xAxis.contains(transformedPos.getX()) && yAxis.contains(transformedPos.getY()); } } protected  RectilinearGridImpl(CoordinateReferenceSystem crs);  RectilinearGridImpl(ReferenceableAxis<Double> xAxis, ReferenceableAxis<Double> yAxis,
            CoordinateReferenceSystem crs); @Override Array2D<GridCell2D> getDomainObjects(); @Override boolean contains(HorizontalPosition position); @Override BoundingBox getBoundingBox(); @Override GeographicBoundingBox getGeographicBoundingBox(); @Override ReferenceableAxis<Double> getXAxis(); @Override ReferenceableAxis<Double> getYAxis(); @Override CoordinateReferenceSystem getCoordinateReferenceSystem(); @Override long size(); @Override GridCoordinates2D findIndexOf(HorizontalPosition position); @Override int getXSize(); @Override int getYSize(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void testContains() throws InvalidCrsException { HorizontalPosition position = new HorizontalPosition(120, 30, crs); assertFalse(rGrid.contains(position)); position = new HorizontalPosition(96.0, 34.6, crs); assertTrue(rGrid.contains(position)); position = new HorizontalPosition(96.0, 40.7, crs); assertTrue(rGrid.contains(position)); assertFalse(rGrid.contains(null)); CoordinateReferenceSystem japanArea = GISUtils.getCrs("EPSG:2450"); assertFalse(rGrid.contains(new HorizontalPosition(17945.194292, 41625.344542, japanArea))); }