Java 8 multiple mapping

Viewed 4153

Is it possible perform multiple mapping on collection? Following code compilation error:

... in Stream cannot be applied to java.util.function.Function<capture<?>,capture<?>>

private static List<?> multipleMapping(final Collection<?> collection, final List<Function<?, ?>> functions) {
    Stream<?> stream = collection.stream();
    for (Function<?, ?> function : functions) {
        stream = stream.map(function);
    }
    return stream.collect(Collectors.toList());
}

I would like to generic solution.

2 Answers
Related