@Test
public void testHashCode() {

    final ForcedRoot initial = new ForcedRoot().withPath("/some/path")
            .withPrimaryType("nt:folder").withMixinTypes("mix:title");
    assertEquals("same equals for same objects", initial, initial);
    assertEquals("same hash for same objects", initial.hashCode(), initial.hashCode());
    final ForcedRoot equalToInitial = new ForcedRoot().withPath("/some/path")
            .withPrimaryType("nt:folder").withMixinTypes("mix:title");
    assertEquals("same equals for equal objects", initial, equalToInitial);
    assertEquals("same hash for equals objects", initial.hashCode(),
            equalToInitial.hashCode());
    final ForcedRoot notEqual = new ForcedRoot().withPath("/other/path")
            .withPrimaryType("nt:folder").withMixinTypes("mix:title");
    assertNotEquals("different equals for nonequal objects", initial, notEqual);
    assertNotEquals("different hash for nonequal objects", initial.hashCode(),
            notEqual.hashCode());
}