title: Compare two files by hashCode
body: <p>I need a class, that will find duplicates in the array. I have a sorted list, in which files will compared on size, and then I want to compare them on (hashCode?) some criterions.  </p>
  
  <pre><code>public class FileComparison {
  
  public void compare(ArrayList&lt;File&gt; arrayOfFiles) throws Exception {
  
  
      for(int i = 0; i &lt; arrayOfFiles.size() - 1; i++) {
          for (int y = i + 1; y &lt; arrayOfFiles.size() - 1; y++) {
              if(arrayOfFiles.get(i).length() == arrayOfFiles.get(y).length()) {
                  //byte[] b1; 
                  //byte[] b2;
                  //don't know what to do     
              }
              if(arrayOfFiles.get(i).length() != arrayOfFiles.get(y).length()) {
                  break;
              }
          } 
      }
  
  }
  </code></pre>
  
  <p>If the size of both files is same - it needs to compare them by another way. If they are same also on this way - files are duplicates.
  If size is different - they are not a duplicates.</p>