Point implements Comparable<Point>, Cloneable, Position { @Override public void setLongitude(final double longitude) { if (Math.abs(longitude) > 180) { throw new IllegalArgumentException( "The given coordinates for longitude " + longitude + " are out of range."); } this.longitude = longitude; } 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 testSetLongitude() { double actual; double expected; String geohash; Point o1; geohash = GeoHashExtensions.encode(53.5526394, 10.0067103); o1 = new GeoHashPoint(geohash); o1.setLongitude(9.8d); actual = o1.getLongitude(); expected = 9.8d; assertEquals(expected, actual); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testSetLongitudeWithUnappropriatedNumber() { String geohash; Point o1; geohash = GeoHashExtensions.encode(53.5526394, 10.0067103); o1 = new GeoHashPoint(geohash); o1.setLongitude(190.0d); }