public void link(Name name, File file) {
    DirectoryEntry entry = new DirectoryEntry(this, checkNotReserved(name, "link"), file);
    put(entry);
    file.linked(entry);
  }
@Test
  public void testLink_parentAndSelfNameFails() {
    try {
      dir.link(Name.simple("."), createDirectory(2));
      fail();
    } catch (IllegalArgumentException expected) {
    }

    try {
      dir.link(Name.simple(".."), createDirectory(2));
      fail();
    } catch (IllegalArgumentException expected) {
    }
  }