@Test
public void testExtractExtension() {

    Collection<Tuple2<String, String>> testEntries = new LinkedList<>();
    testEntries.add(new Tuple2<>("hdfs://xxx/", null));
    testEntries.add(new Tuple2<>("hdfs://xxx/folder/file.txt", "txt"));
    testEntries.add(new Tuple2<>("hdfs://xxx/folder/file.txt.gz", "gz"));
    testEntries.add(new Tuple2<>("hdfs://xxx/folder/file.txt.gz/", "gz"));
    for (Tuple2<String, String> testEntry : testEntries) {
        Path path = new Path(testEntry.f0);
        String extension = FileUtils.extractExtension(path);
        Assert.assertEquals(testEntry.f1, extension);
    }
}