List hi = Collections.nCopies(10, \"Hi\");
List are = Collections.nCopies(10, \"Are\");
hi.addAll(are);
hi.forEach(System.out::println)
As the JavaDoc says, the returned list is immutable, which means you can't modify it:
[nCopies] Returns an immutable list consisting of n copies of the specified object.
Maybe you didn't get the "in combination with the List.addAll" part. You must have a non-immutable list in which you can add all your elements:
List modifiableList = new ArrayList();
List hi = Collections.nCopies(10, "Hi");
List are = Collections.nCopies(10, "Are");
modifiableList.addAll(are);
modifiableList.addAll(hi);
modifiableList.forEach(System.out::println);