Given the following code snippet:
int[] arr = {1, 2, 3}; for (int i : arr) System.out.println(i);
I have the following questions:
For (2), Guava provides exactly what you want as Int.asList(). There is an equivalent for each primitive type in the associated class, e.g., Booleans for boolean, etc.
Booleans
boolean
int[] arr={1,2,3}; for(Integer i : Ints.asList(arr)) { System.out.println(i); }