### Question:
GridDef { @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final GridDef gridDef = (GridDef) o; return width == gridDef.width && height == gridDef.height && time == gridDef.time && Double.compare(gridDef.easting, easting) == 0 && Double.compare(gridDef.northing, northing) == 0 && Double.compare(gridDef.resolutionX, resolutionX) == 0 && Double.compare(gridDef.resolutionY, resolutionY) == 0; } 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 testEquals() throws Exception { assertTrue(GridDef.createGlobal(0.05).equals(GridDef.createGlobal(0.05))); assertFalse(GridDef.createGlobal(0.04).equals(GridDef.createGlobal(0.05))); assertTrue(GridDef.createGlobal(3600, 1800).equals(GridDef.createGlobal(3600, 1800))); assertFalse(GridDef.createGlobal(3600, 1800).equals(GridDef.createGlobal(3600, 1801))); }