final boolean isRootDirectory() {
    // only root directories have their parent link pointing to themselves
    return isDirectory() && equals(((Directory) this).parent());
  }
@Test
  public void testRootDirectory() {
    Directory file = Directory.createRoot(0, fileTimeSource.now(), Name.simple("/"));
    assertThat(file.isRootDirectory()).isTrue();

    Directory otherFile = Directory.createRoot(1, fileTimeSource.now(), Name.simple("$"));
    assertThat(otherFile.isRootDirectory()).isTrue();
  }