@Test
  public void testRemove() {
    dir.put(entry("foo"));
    dir.put(entry("bar"));

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

    assertThat(dir.entryCount()).isEqualTo(3);
    assertThat(ImmutableSet.copyOf(dir))
        .containsExactly(
            entry("bar"),
            new DirectoryEntry(dir, Name.SELF, dir),
            new DirectoryEntry(dir, Name.PARENT, root));
    assertThat(dir.get(Name.simple("foo"))).isNull();
    assertThat(dir.get(Name.simple("bar"))).isEqualTo(entry("bar"));

    dir.remove(Name.simple("bar"));

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

    dir.put(entry("bar"));
    dir.put(entry("foo")); // these should just succeeded
  }
Tests for {@link Directory}.

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