@Test
  public void testLinkAndUnlink() {
    File file = regularFile(0);
    assertThat(file.links()).isEqualTo(0);

    file.incrementLinkCount();
    assertThat(file.links()).isEqualTo(1);

    file.incrementLinkCount();
    assertThat(file.links()).isEqualTo(2);

    file.decrementLinkCount();
    assertThat(file.links()).isEqualTo(1);

    file.decrementLinkCount();
    assertThat(file.links()).isEqualTo(0);
  }
Tests for {@link File}.

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