Stream puzzler

Remi Forax forax at univ-mlv.fr
Mon Jan 14 00:19:38 PST 2013


Using the last binary drop (otherwise replace accumulate by collect),
can you spot the bug (hint, it doesn't compile).

import java.util.Arrays;
import java.util.List;
import java.util.stream.Accumulators;

import static java.util.stream.Accumulators.*;

public class Bug {
   public static List<Object> intoList(Object[] args) {
     return Arrays.stream(args).accumulate(intoList());
   }
}

Are we able to do something for that ?

Rémi



More information about the lambda-libs-spec-experts mailing list