### 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.latLong.equals(other.latLong)) { return false; } else if (this.zoomLevel != other.zoomLevel) { return false; } return true; } MapPosition(LatLong latLong, byte zoomLevel); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); final LatLong latLong; final byte zoomLevel; }### Answer:
@Test public void equalsTest() { MapPosition mapPosition1 = new MapPosition(new LatLong(1.0, 2.0), (byte) 3); MapPosition mapPosition2 = new MapPosition(new LatLong(1.0, 2.0), (byte) 3); MapPosition mapPosition3 = new MapPosition(new LatLong(1.0, 2.0), (byte) 0); MapPosition mapPosition4 = new MapPosition(new LatLong(0, 0), (byte) 3); TestUtils.equalsTest(mapPosition1, mapPosition2); TestUtils.notEqualsTest(mapPosition1, mapPosition3); TestUtils.notEqualsTest(mapPosition1, mapPosition4); TestUtils.notEqualsTest(mapPosition1, new Object()); TestUtils.notEqualsTest(mapPosition1, null); }