 <p>There's no generic method that can work with primitives, because primitives can't be a generic type. The closest you could come in pure Java is to overload <code>getArrayList</code> with an <code>int[]</code>...</p> <pre><code>public static ArrayList&lt;Integer&gt; getArrayList(int[] a){ ArrayList&lt;Integer&gt; retList = new ArrayList&lt;Integer&gt;(); for (int i : a){ retList.add(i); } return retList; } </code></pre> <p>which will box your <code>int</code> for you. It's not generic, and you'd need a new overload for each primitive array type, but that's the closest solution I can think of.</p>