HdfEosGridInfo { public boolean equalProjections(HdfEosGridInfo that) { if (this == that) return true; if (Double.compare(that.lowerRightLat, lowerRightLat) != 0) return false; if (Double.compare(that.lowerRightLon, lowerRightLon) != 0) return false; if (Double.compare(that.upperLeftLat, upperLeftLat) != 0) return false; if (Double.compare(that.upperLeftLon, upperLeftLon) != 0) return false; if (!Arrays.equals(that.projectionParameter, projectionParameter)) return false; if (!projection.equals(that.projection)) return false; return true; } HdfEosGridInfo(String gridName,
                   double upperLeftLon, double upperLeftLat,
                   double lowerRightLon, double lowerRightLat,
                   String projection); boolean equalProjections(HdfEosGridInfo that); void setProjectionParameter(double[] projectionParameter); double[] getProjectionParameter();  }
@Test public void testGridInfosAreEqual() throws Exception { HdfEosGridInfo gridInfo1 = new HdfEosGridInfo("testName", -120, 50, -100, 40, "Sinusoidal"); HdfEosGridInfo gridInfo2 = new HdfEosGridInfo("testName", -120, 50, -100, 40, "Sinusoidal"); assertTrue(gridInfo1.equalProjections(gridInfo2)); }
@Test public void testGridInfosAreNotEqual() throws Exception { HdfEosGridInfo gridInfo1 = new HdfEosGridInfo("testName", -120, 50.1, -100, 40, "Sinusoidal"); HdfEosGridInfo gridInfo2 = new HdfEosGridInfo("testName", -120, 50, -100, 40, "Sinusoidal"); assertFalse(gridInfo1.equalProjections(gridInfo2)); }