@Test
  public void testHashCode() {
    Path p1 = new Path("/p1");
    Path p2 = new Path("/p2");
    Path p3 = new Path("/p3");

    assertEquals(new FileLink().hashCode(), new FileLink().hashCode());
    assertEquals(new FileLink(p1).hashCode(), new FileLink(p1).hashCode());
    assertEquals(new FileLink(p1, p2).hashCode(), new FileLink(p1, p2).hashCode());
    assertEquals(new FileLink(p1, p2, p3).hashCode(), new FileLink(p1, p2, p3).hashCode());

    assertNotEquals(new FileLink(p1).hashCode(), new FileLink(p3).hashCode());
    assertNotEquals(new FileLink(p1, p2).hashCode(), new FileLink(p1).hashCode());
    assertNotEquals(new FileLink(p1, p2).hashCode(), new FileLink(p2).hashCode());
    assertNotEquals(new FileLink(p1, p2).hashCode(), new FileLink(p2, p1).hashCode()); // ordering
  }
Test that FileLink switches between alternate locations when the current location moves or gets
deleted.
hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java