### Question:
GHPoint3D extends GHPoint { @Override public boolean equals(Object obj) { if (obj == null) return false; @SuppressWarnings("unchecked") final GHPoint3D other = (GHPoint3D) obj; if (Double.isNaN(ele)) return NumHelper.equalsEps(lat, other.lat) && NumHelper.equalsEps(lon, other.lon); else return NumHelper.equalsEps(lat, other.lat) && NumHelper.equalsEps(lon, other.lon) && NumHelper.equalsEps(ele, other.ele); } GHPoint3D(double lat, double lon, double elevation); double getElevation(); double getEle(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); @Override Double[] toGeoJson(); public double ele; }### Answer:
@Test public void testEquals() { GHPoint3D point1 = new GHPoint3D(1, 2, Double.NaN); GHPoint3D point2 = new GHPoint3D(1, 2, Double.NaN); assertEquals(point1, point2); point1 = new GHPoint3D(1, 2, 0); point2 = new GHPoint3D(1, 2, 1); assertNotEquals(point1, point2); point1 = new GHPoint3D(1, 2, 0); point2 = new GHPoint3D(1, 2.1, 0); assertNotEquals(point1, point2); point1 = new GHPoint3D(1, 2.1, 0); point2 = new GHPoint3D(1, 2.1, 0); assertEquals(point1, point2); }