Geocode { @Override public String toString() { return latitude + "," + longitude + "," + radius + distance.identifier; } Geocode(double latitude, double longitude, int radius, Distance distance); @Override String toString(); final double latitude; final double longitude; final int radius; final Distance distance; }
@Test public void testToString() { final Geocode geocode = new Geocode(1.0, 1.0, 1, Geocode.Distance.MILES); assertEquals("1.0,1.0,1mi", geocode.toString()); }