FileStatus implements Writable, Comparable { @Override public boolean equals(Object o) { if (o == null) { return false; } if (this == o) { return true; } if (!(o instanceof FileStatus)) { return false; } FileStatus other = (FileStatus)o; return this.getPath().equals(other.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(Object o); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }
@Test public void testEquals() { Path path = new Path("path"); FileStatus fileStatus1 = new FileStatus(1, true, 1, 1, 1, 1, FsPermission.valueOf("-rw-rw-rw-"), "one", "one", null, path); FileStatus fileStatus2 = new FileStatus(2, true, 2, 2, 2, 2, FsPermission.valueOf("---x--x--x"), "two", "two", null, path); assertEquals(fileStatus1, fileStatus2); }
@Test public void testNotEquals() { 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); assertFalse(fileStatus1.equals(fileStatus2)); assertFalse(fileStatus2.equals(fileStatus1)); }