Point implements Comparable<Point>, Cloneable, Position { @Override public void setLatitude(final double latitude) { if (Math.abs(latitude) > 90) { throw new IllegalArgumentException( "The given coordinates for latitude " + latitude + " are out of range."); } this.latitude = latitude; } Point(final double latitude, final double longitude); @Override Object clone(); @Override int compareTo(final Point other); @Override double getLatitude(); @Override double getLongitude(); @Override void setLatitude(final double latitude); @Override void setLongitude(final double longitude); @Override String toString();  }
@Test public void testSetLatitude() { double actual; double expected; Point o1; o1 = new GeoHashPoint(GeoHashExtensions.encode(53.5526394, 10.0067103)); o1.setLatitude(52.0d); actual = o1.getLatitude(); expected = 52.0d; assertEquals(expected, actual); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testSetLatitudeUnappropriateLatitudeNumber() { Point o1 = new GeoHashPoint(GeoHashExtensions.encode(53.5526394, 10.0067103)); o1.setLatitude(100.0d); }