### Question:
GenericLocation implements Cloneable { @Override public String toString() { if (this.place != null && !this.place.isEmpty()) { if (this.name == null || this.name.isEmpty()) { return this.place; } else { return String.format("%s::%s", this.name, this.place); } } return String.format("%s,%s", this.lat, this.lng); } GenericLocation();  GenericLocation(double lat, double lng);  GenericLocation(Coordinate coord);  GenericLocation(double lat, double lng, double heading);  GenericLocation(String name, String place);  GenericLocation(NamedPlace np); static GenericLocation fromOldStyleString(String input); boolean hasHeading(); boolean hasName(); boolean hasPlace(); boolean hasCoordinate(); boolean hasEdgeId(); NamedPlace getNamedPlace(); Coordinate getCoordinate(); @Override String toString(); String toDescriptiveString(); @Override GenericLocation clone();  }### Answer:
@Test public void testToString() { String input = "name::1.0,2.5"; GenericLocation loc = GenericLocation.fromOldStyleString(input); assertEquals(input, loc.toString()); assertTrue(loc.hasCoordinate()); assertFalse(loc.hasHeading()); input = "name::12345"; loc = GenericLocation.fromOldStyleString(input); assertEquals(input, loc.toString()); assertFalse(loc.hasCoordinate()); assertFalse(loc.hasHeading()); input = "name"; loc = GenericLocation.fromOldStyleString(input); assertEquals(input, loc.toString()); assertFalse(loc.hasCoordinate()); assertFalse(loc.hasHeading()); }