### Question:
GenericLocation implements Cloneable { public static GenericLocation fromOldStyleString(String input) { String name = ""; String place = input; if (input.contains("::")) { String[] parts = input.split("::"); name = parts[0]; place = parts[1]; } return new GenericLocation(name, place); } 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 testFromOldStyleString() { GenericLocation loc = GenericLocation.fromOldStyleString("name::12345"); assertEquals("name", loc.getName()); assertEquals("12345", loc.getPlace()); NamedPlace np = loc.getNamedPlace(); assertEquals("name", np.name); assertEquals("12345", np.place); assertTrue(loc.hasName()); assertTrue(loc.hasPlace()); assertFalse(loc.hasCoordinate()); assertFalse(loc.hasHeading()); assertNull(loc.getLat()); assertNull(loc.getLng()); assertNull(loc.getCoordinate()); }
@Test public void testFromStringWithEdgeAndHeading() { String s = "40.75542978896869,-73.97618338000376 heading=29.028895183287617 edgeId=2767"; GenericLocation loc = GenericLocation.fromOldStyleString(s); assertEquals(29.028895183287617, loc.getHeading(), 0.00001); assertEquals(2767, loc.getEdgeId().intValue()); assertEquals(40.75542978896869, loc.getLat(), 0.00001); assertEquals(-73.97618338000376, loc.getLng(), 0.00001); }