title: Java: Array of primitive data types does not autobox
body: <p>I have a method like this:</p>
  
  <pre><code>public static &lt;T&gt; boolean isMemberOf(T item, T[] set)
  {
      for (T t : set) {
          if (t.equals(item)) {
              return true;
          }
      }
      return false;
  }
  </code></pre>
  
  <p>Now I try to call this method using a <code>char</code> for <code>T</code>:</p>
  
  <pre><code>char ch = 'a';
  char[] chars = new char[] { 'a', 'b', 'c' };
  boolean member = isMemberOf(ch, chars);
  </code></pre>
  
  <p>This doesn't work. I would expect the <code>char</code> and <code>char[]</code> to get autoboxed to <code>Character</code> and <code>Character[]</code>, but that doesn't seem to happen.</p>
  
  <p>Any insights?</p>