I\'m googling it and can\'t seem to find the syntax. My arraylist might be populated differently based on a user setting, so I\'ve initialized it
Collections.addAll is a varargs method which allows us to add any number of items to a collection in a single statement:
List list = new ArrayList<>();
Collections.addAll(list, 1, 2, 3, 4, 5);
It can also be used to add array elements to a collection:
Integer[] arr = ...;
Collections.addAll(list, arr);