@Test
  public void testGetUnderlyingFSDataInputStream() throws Exception {
    HBaseTestingUtil testUtil = new HBaseTestingUtil();
    Configuration conf = testUtil.getConfiguration();
    conf.setInt("dfs.blocksize", 1024 * 1024);
    conf.setInt("dfs.client.read.prefetch.size", 2 * 1024 * 1024);

    testUtil.startMiniDFSCluster(1);
    try {
      MiniDFSCluster cluster = testUtil.getDFSCluster();
      FileSystem fs = cluster.getFileSystem();

      Path originalPath = new Path(testUtil.getDefaultRootDirPath(), "test.file");

      writeSomeData(fs, originalPath, 256 << 20, (byte) 2);

      List<Path> files = new ArrayList<Path>();
      files.add(originalPath);

      FileLink link = new FileLink(files);
      FSDataInputStream stream = link.open(fs);

      FSDataInputStream underlying = FileLink.getUnderlyingFileLinkInputStream(stream);
      assertTrue(underlying instanceof HdfsDataInputStream);
    } finally {
      testUtil.shutdownMiniCluster();
    }
  }
Test that the returned link from {@link FileLink#open(FileSystem)} can be unwrapped to a
{@link HdfsDataInputStream} by
{@link FileLink#getUnderlyingFileLinkInputStream(FSDataInputStream)}
hbase-server/src/test/java/org/apache/hadoop/hbase/io/TestFileLink.java