@Test
  public void testInitialAttributes() {
    // unix provider relies on other providers to set their initial attributes
    file.setAttribute("owner", "owner", createUserPrincipal("foo"));
    file.setAttribute("posix", "group", createGroupPrincipal("bar"));
    file.setAttribute(
        "posix", "permissions", ImmutableSet.copyOf(PosixFilePermissions.fromString("rw-r--r--")));

    // these are pretty much meaningless here since they aren't properties this
    // file system actually has, so don't really care about the exact value of these
    assertThat(provider.get(file, "uid")).isInstanceOf(Integer.class);
    assertThat(provider.get(file, "gid")).isInstanceOf(Integer.class);
    assertThat(provider.get(file, "rdev")).isEqualTo(0L);
    assertThat(provider.get(file, "dev")).isEqualTo(1L);
    assertThat(provider.get(file, "ino")).isInstanceOf(Integer.class);

    // these have logical origins in attributes from other views
    assertThat(provider.get(file, "mode")).isEqualTo(0644); // rw-r--r--
    assertThat(provider.get(file, "ctime")).isEqualTo(file.getCreationTime());

    // this is based on a property this file system does actually have
    assertThat(provider.get(file, "nlink")).isEqualTo(1);

    file.incrementLinkCount();
    assertThat(provider.get(file, "nlink")).isEqualTo(2);
    file.decrementLinkCount();
    assertThat(provider.get(file, "nlink")).isEqualTo(1);
  }
Tests for {@link UnixAttributeProvider}.

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