title: Java - A method that takes vararg and returns arraylist?
body: <p>I'm not entirely comfortable with generics and thus haven't found a solution to this yet. I have these three methods:</p>
  
  <pre><code>public static List&lt;ObjectA&gt; objectAAsList(ObjectA ... items) {
      return new ArrayList&lt;&gt;(Arrays.asList(items));
  }
  
  public static List&lt;ObjectB&gt; objectBAsList(ObjectB ... items) {
      return new ArrayList&lt;&gt;(Arrays.asList(items));
  }
  
  public static List&lt;ObjectC&gt; objectCAsList(ObjectC ... items) {
      return new ArrayList&lt;&gt;(Arrays.asList(items));
  }
  </code></pre>
  
  <p>How can I create a single method that takes a vararg of T (or something) and creates an ArrayList of it?</p>