Como reterTodas as listas de listas usando fluxo reduzir
Eu enfrentei o seguinte problema. Eu tenho uma lista de listas que eu simplesmente quero reter. Eu estou tentando fazer com fluxos
private List<List<Long>> ids = new ArrayList<List<Long>>();
// some ids.add(otherLists);
List<Long> reduce = ids.stream().reduce(ids.get(0), (a, b) -> a.addAll(b));
infelizmente eu entendi o erro
Error:(72, 67) java: incompatible types: bad return type in lambda expression
boolean cannot be converted to java.util.List<java.lang.Long>