@Override
    public int compare(final Path o1, final Path o2) {
        if(o1.isDirectory() && o2.isDirectory()) {
            return 0;
        }
        if(o1.isFile() && o2.isFile()) {
            return 0;
        }
        if(o1.isDirectory()) {
            return -1;
        }
        if(o2.isDirectory()) {
            return 1;
        }
        return 0;
    }
@Test
    public void testCompare() {
        assertEquals(-1, new PathPriorityComparator().compare(
                new Path("/t", EnumSet.of(Path.Type.directory)),
                new Path("/t", EnumSet.of(Path.Type.file))
        ));
        assertEquals(1, new PathPriorityComparator().compare(
                new Path("/t", EnumSet.of(Path.Type.file)),
                new Path("/t", EnumSet.of(Path.Type.directory))
        ));
        assertEquals(0, new PathPriorityComparator().compare(
                new Path("/t", EnumSet.of(Path.Type.directory)),
                new Path("/t", EnumSet.of(Path.Type.directory))
        ));
        assertEquals(0, new PathPriorityComparator().compare(
                new Path("/t", EnumSet.of(Path.Type.file)),
                new Path("/t", EnumSet.of(Path.Type.file))
        ));
    }