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

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

    assertNotEquals(new FileLink(p1), new FileLink(p3));
    assertNotEquals(new FileLink(p1, p2), new FileLink(p1));
    assertNotEquals(new FileLink(p1, p2), new FileLink(p2));
    assertNotEquals(new FileLink(p1, p2), new FileLink(p2, p1)); // ordering important!
  }
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