title: Hashcode with generic types
body: <p>Looking for a method to easily calculate hashes for arbitrary types. Given the following class:</p>
  
  <pre><code>class Foo&lt;T&gt; {
      ...
      T value;
  }
  </code></pre>
  
  <p>I have already overridden the <code>equals</code> method using <code>Objects.deepEquals</code> to compare the <code>value</code> fields. Is there an easy way to do the same with <code>hashCode</code>? Some utility method in guava or apache commons (i'm already using them for other things) ?</p>
  
  <p>Unfortunately <code>Objects.hash(field1, ... , value)</code> does not work when value is an array.</p>
  
  <p>I know one option is to do</p>
  
  <pre><code>Arrays.deepHashCode(new Object[]{ field1, ... , value });
  </code></pre>
  
  <p>but it feels wrong to create a new array for that instead of just looping it</p>