### Question:
MapPosition implements Serializable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } else if (!(obj instanceof MapPosition)) { return false; } MapPosition other = (MapPosition) obj; if (this.geoPoint == null) { if (other.geoPoint != null) { return false; } } else if (!this.geoPoint.equals(other.geoPoint)) { return false; } else if (this.zoomLevel != other.zoomLevel) { return false; } return true; } MapPosition(GeoPoint geoPoint, byte zoomLevel); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); final GeoPoint geoPoint; final byte zoomLevel; }### Answer:
@Test public void equalsTest() { MapPosition mapPosition1 = new MapPosition(GEO_POINT, ZOOM_LEVEL); MapPosition mapPosition2 = new MapPosition(GEO_POINT, ZOOM_LEVEL); MapPosition mapPosition3 = new MapPosition(GEO_POINT, (byte) 0); TestUtils.equalsTest(mapPosition1, mapPosition2); Assert.assertNotEquals(mapPosition1, mapPosition3); Assert.assertNotEquals(mapPosition3, mapPosition1); Assert.assertNotEquals(mapPosition1, new Object()); }