import java.io.PrintWriter;
import java.io.StringWriter;
-import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.Callable;
@SuppressWarnings({ "rawtypes", "unchecked" })
public static List<Object> pmap(Function f, List<Object> l) {
- return Arrays.asList(l.parallelStream().map(a -> f.apply(a)).toArray());
+ return l.parallelStream().map(f::apply).collect(Collectors.toList());
}
@SuppressWarnings({ "rawtypes", "unchecked" })