FileStatus implements Writable, Comparable<FileStatus> { @Override public int compareTo(FileStatus o) { return this.getPath().compareTo(o.getPath()); } FileStatus();  FileStatus(long length, boolean isdir, int block_replication,
                    long blocksize, long modification_time, Path path);  FileStatus(long length, boolean isdir,
                    int block_replication,
                    long blocksize, long modification_time, long access_time,
                    FsPermission permission, String owner, String group, 
                    Path path);  FileStatus(long length, boolean isdir,
                    int block_replication,
                    long blocksize, long modification_time, long access_time,
                    FsPermission permission, String owner, String group, 
                    Path symlink,
                    Path path);  FileStatus(FileStatus other); long getLen(); boolean isFile(); boolean isDirectory(); @Deprecated boolean isDir(); boolean isSymlink(); long getBlockSize(); short getReplication(); long getModificationTime(); long getAccessTime(); FsPermission getPermission(); boolean isEncrypted(); String getOwner(); String getGroup(); Path getPath(); void setPath(final Path p); Path getSymlink(); void setSymlink(final Path p); @Override void write(DataOutput out); @Override void readFields(DataInput in); @Override int compareTo(FileStatus o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testCompareTo() throws IOException { Path path1 = new Path("path1"); Path path2 = new Path("path2"); FileStatus fileStatus1 = new FileStatus(1, true, 1, 1, 1, 1, FsPermission.valueOf("-rw-rw-rw-"), "one", "one", null, path1); FileStatus fileStatus2 = new FileStatus(1, true, 1, 1, 1, 1, FsPermission.valueOf("-rw-rw-rw-"), "one", "one", null, path2); assertTrue(fileStatus1.compareTo(fileStatus2) < 0); assertTrue(fileStatus2.compareTo(fileStatus1) > 0); List<FileStatus> statList = new ArrayList<>(); statList.add(fileStatus1); statList.add(fileStatus2); assertTrue(Collections.binarySearch(statList, fileStatus1) > -1); }