If you would have read the Javadoc of java.io.File you would have seen the following:
Compares two abstract pathnames lexicographically. The ordering defined by this method depends upon the underlying system. On UNIX systems, alphabetic case is significant in comparing pathnames; on Microsoft Windows systems it is not.
So no, it doesn't check the contents, just the result of getPath().
Whoops, quote tags, not code tags!