So the following code:
scoreCombiner = (Collection<ScoreContainer> subScores) -> subScores.parallelStream()
.mapToInt(ScoreContainer::getScore)
.reduce((a, b) -> a + b);
where scoreCombiner
is a field declared as
private final ToIntFunction<? super List<? super ScoreContainer>> scoreCombiner;
is giving me the error Type mismatch: cannot convert from ToIntFunction<Collection<ScoreContainer>> to ToIntFunction<? super List<? super ScoreContainer>>
which I can't understand. Collection is definitely a super-type of List, and ScoreContainer is, of course, a super-type of itself. Any help would be appreciated.