@Test
public void testPathCompareByValue() {

    KeySpace keySpace = new KeySpace(
            new KeySpaceDirectory("a", KeyType.STRING)
                    .addSubdirectory(new KeySpaceDirectory("b", KeyType.STRING)
                            .addSubdirectory(new KeySpaceDirectory("d", KeyType.STRING, TestWrapper1::new)))
                    .addSubdirectory(new KeySpaceDirectory("c", KeyType.LONG)
                            .addSubdirectory(new KeySpaceDirectory("d", KeyType.STRING, TestWrapper1::new))));
    final KeySpacePath p1 = keySpace.path("a", "alpha")
            .add("b", "bravo")
            .add("d", "delta");
    final KeySpacePath p2 = keySpace.path("a", "alpha")
            .add("b", "bravo")
            .add("d", "duck");
    final KeySpacePath p3 = keySpace.path("a", "alpha")
            .add("c", 23)
            .add("d", "delta");
    final KeySpacePath sameAsP1 = keySpace.path("a", "alpha")
            .add("b", "bravo")
            .add("d", "delta");
    assertNotEquals(p1, p2, "paths have different values");
    assertNotEquals(p1.hashCode(), p2.hashCode(), "they have distinct hash codes");
    assertNotEquals(p1, p3, "paths have different parents");
    assertNotEquals(p1.hashCode(), p3.hashCode(), "they have distinct hash codes");
    assertNotSame(p1, sameAsP1, "the paths are not equal by reference");
    assertEquals(p1, sameAsP1, "they are equal by value");
    assertEquals(p1.hashCode(), sameAsP1.hashCode(), "they have the same hash code");
}