@Test
public void fileExistsHdfs() throws IOException {

    final Configuration conf = new Configuration(false);
    conf.setClass("fs.hdfs.impl", MockFileSystem.class, FileSystem.class);
    final File file = File.createTempFile("kylo-", ".tmp");
    try {
        Assert.assertTrue("Expected HDFS file to exist", FileSystemUtil.fileExists(URI.create("hdfs:" + file.getAbsolutePath()), conf));
        Assert.assertTrue("Expected HDFS file to exist", FileSystemUtil.fileExists(URI.create("hadoop:hdfs:" + file.getAbsolutePath()), conf));
    } finally {
        Files.delete(file.toPath());
    }
}