import java.util.List; import java.util.Random; import java.util.stream.Collectors; class Ideone { .ints(10) .map(value -> value >= 0 ? value : -value) .map(value -> value % 100) .boxed() .collect(Collectors.toList()); final List<Integer> evens = extractEvens(randomNumbers); } public static List<Integer> extractEvens(final List<Integer> numbers) { return numbers.stream() .filter(value -> value % 2 == 0) .collect(Collectors.toList()); } }
Standard input is empty