### Question:
Location implements Iterable<Property>, Comparable<Location>, Serializable { public static Location create( Path path ) { CheckArg.isNotNull(path, "path"); UUID id = identifierFor(path); if (id != null) return new LocationWithUuid(id); return new LocationWithPath(path); }  static final Comparator<Location> comparator(); static Location create( Path path ); static Location create( UUID uuid ); static Location create( Path path,
                                   UUID uuid ); static Location create( Path path,
                                   Property idProperty ); static Location create( Path path,
                                   Property firstIdProperty,
                                   Property... remainingIdProperties ); static Location create( Path path,
                                   Iterable<Property> idProperties ); static Location create( Property idProperty ); static Location create( Property firstIdProperty,
                                   Property... remainingIdProperties ); static Location create( Iterable<Property> idProperties ); static Location create( List<Property> idProperties ); abstract Path getPath(); boolean hasPath(); abstract List<Property> getIdProperties(); boolean hasIdProperties(); Property getIdProperty( Name name ); UUID getUuid(); boolean isSame( Location that ); Iterator<Property> iterator(); @Override int hashCode(); @Override boolean equals( Object obj ); boolean equals( Object obj,
                           boolean requireSameNameSiblingIndexes ); int compareTo( Location that ); String getString(); String getString( TextEncoder encoder ); String getString( NamespaceRegistry namespaceRegistry ); String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder ); String getString( NamespaceRegistry namespaceRegistry,
                             TextEncoder encoder,
                             TextEncoder delimiterEncoder ); @Override String toString(); abstract Location with( Property newIdProperty ); abstract Location with( Path newPath ); abstract Location with( UUID uuid );  }### Answer:
@Test public void locationsWithSamePathsAreEqual() { Location locationA1 = Location.create(pathA); Location locationA2 = Location.create(pathA); assertThat("Locations created with identical paths must be equal", locationA1, is(locationA2)); Location locationABC1 = Location.create(pathABC); Location locationABC2 = Location.create(pathABC); assertThat("Locations created with identical non-trivial paths must be equal", locationABC1, is(locationABC2)); }
@Test public void locationsWithSamePathsAndSamePropertyAreNotEqual() { Location locationA1 = Location.create(pathA, propA); Location locationA2 = Location.create(pathA, propA); assertThat("Locations created with identical paths and different property must be equal", locationA1, is(locationA2)); }
@Test public void locationsWithDifferentPathsAndSamePropertyAreNotEqual() { Location locationA1 = Location.create(pathA, propA); Location locationA2 = Location.create(pathABC, propA); assertThat("Locations created with different paths and the same property must not be equal", locationA1, not(locationA2)); }
@Test public void locationsWithSamePathsAndSamePropertiesAreNotEqual() { Location locationA1 = Location.create(pathA, propListAB); Location locationA2 = Location.create(pathA, propListAB); assertThat("Locations created with identical paths and different properties must be equal", locationA1, is(locationA2)); }
@Test public void locationsWithDifferentPathsAndSamePropertiesAreNotEqual() { Location locationA1 = Location.create(pathA, propListAB); Location locationA2 = Location.create(pathABC, propListAB); assertThat("Locations created with identical paths and different properties must not be equal", locationA1, not(locationA2)); }