### Question:
GridDef { public Rectangle2D getLonLatRectangle(int x, int y) { double lon1 = getLon(x); double lat1 = getLat(y + 1.0); return new Rectangle2D.Double(lon1, lat1, resolutionX, resolutionY); } private  GridDef(int width, int height, double easting, double northing, double resolutionX, double resolutionY); static GridDef createGlobal(double resolution); static GridDef createGlobal(int width, int height); static GridDef createRaster(int width, int height); int getTime(); int getWidth(); int getHeight(); double getEasting(); double getNorthing(); double getResolutionX(); double getResolutionY(); double getResolution(); int wrapX(int x); double getCenterLon(int x); double getCenterLat(int y); final double getDiagonal(int x, int y); final int getGridX(double lon, boolean crop); final int getGridY(double lat, boolean crop); Rectangle2D getLonLatRectangle(int x, int y); Rectangle getGridRectangle(Rectangle2D lonLatRectangle); Rectangle getGridRectangle(double minLon, double minLat, double maxLon, double maxLat); Rectangle getGridRectangle(int x, int y, GridDef gridDef); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testGetLonLatRectangle() throws Exception { assertEquals(new Rectangle2D.Double(-180.0, 89.95, 0.05, 0.05), gridDef05.getLonLatRectangle(0, 0)); assertEquals(new Rectangle2D.Double(0.0, 0.0, 0.05, 0.05), gridDef05.getLonLatRectangle(gridDef05.getWidth() / 2, gridDef05.getHeight() / 2 - 1)); }