title: How to add an Array into Set properly?
body: <p>I'm trying to add in Integer array into Set as following, </p>
  
  <pre><code>int[] arr = { 2, 6, 4 , 2, 3, 3, 1, 7 }; 
  Set&lt;Integer&gt; set = new HashSet&lt;Integer&gt;(Arrays.asList(arr));
  </code></pre>
  
  <p>I'm getting some error telling as following, </p>
  
  <pre><code>myTest.java:192: error: no suitable constructor found for HashSet(List&lt;int[]&gt;)
      Set&lt;Integer&gt; set = new HashSet&lt;Integer&gt;(Arrays.asList(arr));
                         ^
  constructor HashSet.HashSet(Collection&lt;? extends Integer&gt;) is not applicable
    (argument mismatch; inferred type does not conform to upper bound(s)
        inferred: int[]
        upper bound(s): Integer,Object)
  constructor HashSet.HashSet(int) is not applicable
    (argument mismatch; no instance(s) of type variable(s) T exist so that List&lt;T&gt; conforms to int)
   where T is a type-variable:
  T extends Object declared in method &lt;T&gt;asList(T...)
  Note: Some messages have been simplified; recompile with -Xdiags:verbose to        get full output
     1 error
  </code></pre>
  
  <p>Secondly, I also tries as following and still getting error,</p>
  
  <pre><code>int[] arr = { 2, 6, 4 , 2, 3, 3, 1, 7 }; 
  Set&lt;Integer&gt; set = new HashSet&lt;Integer&gt;( );
  Collections.addAll(set, arr);
  </code></pre>
  
  <p>How to add an Integer array into Set in Java properly ? Thanks. </p>