@Test
  public void testUnlinkDirectory() {
    Directory newDir = createDirectory(10);

    dir.link(Name.simple("foo"), newDir);

    assertThat(dir.links()).isEqualTo(3);

    assertThat(newDir.entryInParent()).isEqualTo(entry(dir, "foo", newDir));
    assertThat(newDir.links()).isEqualTo(2);

    dir.unlink(Name.simple("foo"));

    assertThat(dir.links()).isEqualTo(2);

    assertThat(newDir.entryInParent()).isEqualTo(entry(dir, "foo", newDir));
    assertThat(newDir.get(Name.SELF).file()).isEqualTo(newDir);
    assertThat(newDir.get(Name.PARENT)).isEqualTo(entry(newDir, "..", dir));
    assertThat(newDir.links()).isEqualTo(1);
  }
Tests for {@link Directory}.

@author Colin Decker
jimfs/src/test/java/com/google/common/jimfs/DirectoryTest.java