In python I can do the following:
n = 8
a = []
a += [1]*n
How can I do the equivalent in java with ArrayLists (without using a for loop..)?
List<T> list = new ArrayList<T>();
list.add(1);
list.add(2);
list.add(3);
// Some construct that is equivalent to a += [1]*n
List.addAll(Collection)