I've tried this StackOverflow answer's code, but I get the error Cannot infer type argument(s) for <R> map(Function<? super T,? extends R>):
//data is int[][]
Arrays.stream(data)
.map(i -> Arrays.stream(i)
.collect(Collectors.toList()))
.collect(Collectors.toList());