another one liner solution using Java8
stream, since flatMap
solution is already posted, here is a solution without flatMap
List<E> li = lol.stream().collect(ArrayList::new, List::addAll, List::addAll);
or
List<E> ints = Stream.of(list1, list2).collect(ArrayList::new, List::addAll, List::addAll);
code
List<List<Integer>> lol = Arrays.asList(Arrays.asList(1, 2, 3), Arrays.asList(4, 5, 6));
List<Integer> li = lol.stream().collect(ArrayList::new, List::addAll, List::addAll);
System.out.println(lol);
System.out.println(li);
output
[[1, 2, 3], [4, 5, 6]]
[1, 2, 3, 4, 5, 6]