Skip to main content
✏️ Code CompletionJV Java Hard+35 XP

Stream API

Complete the stream operation.

✏️ Fill in the blank
List<Integer> nums = Arrays.asList(1, 2, 3, 4, 5);
int sum = nums.stream()
    .filter(n -> n > 2)
    .___((a, b) -> a + b)
    .orElse(0);

✏️ Type the missing code: