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

    assertThat(dir.entryCount()).isEqualTo(3);
    assertThat(ImmutableSet.copyOf(dir)).contains(entry("foo"));
    assertThat(dir.get(Name.simple("foo"))).isEqualTo(entry("foo"));

    dir.put(entry("bar"));

    assertThat(dir.entryCount()).isEqualTo(4);
    assertThat(ImmutableSet.copyOf(dir)).containsAtLeast(entry("foo"), entry("bar"));
    assertThat(dir.get(Name.simple("foo"))).isEqualTo(entry("foo"));
    assertThat(dir.get(Name.simple("bar"))).isEqualTo(entry("bar"));
  }
Tests for {@link Directory}.

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