### Question:
GoogleMapsGeocoder implements Geocoder { public GWTLatLng geocode(String geolocation) throws GeocoderException { try { List<GeoAddress> addresses = m_standardizer.standardizeToGeoAddresses(geolocation); if (addresses.size() > 0) { if (addresses.size() > 1) { LogUtils.warnf(this, "received more than one address for geolocation '%s', returning the first", geolocation); } return getLatLng(addresses.get(0).getCoordinate()); } throw new GeocoderException("unable to find latitude/longitude for geolocation '" + geolocation + "'"); } catch (Throwable e) { LogUtils.infof(this, e, "unable to convert geolocation '%s'", geolocation); throw new GeocoderException(e); } } GoogleMapsGeocoder(); GWTLatLng geocode(String geolocation);  }### Answer:
@Test public void testGoogleLookupSuccess() throws Exception { if (shouldRun()) { Geocoder geocoder = new GoogleMapsGeocoder(); final GWTLatLng remote = geocoder.geocode("220 Chatham Business Dr, Pittsboro, NC 27312"); final GWTLatLng local = new GWTLatLng(35.717372, -79.161857); assertEquals(local.hashCode(), remote.hashCode()); assertEquals(local, remote); } }
@Test public void testGoogleLookupFailure() { if (shouldRun()) { Geocoder geocoder = new GoogleMapsGeocoder(); try { geocoder.geocode("asdasdasdasdasdasdasdasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdfasdf"); assertTrue("this should throw an exception", false); } catch (GeocoderException e) { assertEquals("geo.google.GeoException: Error Status Code: G_GEO_UNKNOWN_ADDRESS", e.getMessage()); } } }