What is the result?

Report a typo

Given a list of numbers:

List<Integer> numbers = Arrays.asList(-1, 0, 1, -2, 2, 3, -4, 5, -6);

Here is a piece of code with streams:

List<Integer> resultList = numbers.stream()
        .filter(n -> n < 4)
        .map(n -> n * n)
        .filter(n -> n < 10)
        .distinct()
        .collect(Collectors.toList());

What numbers does resultList contain?

Select one option from the list
___

Create a free account to access the full topic