concept unique element in category java

This is an excerpt from Manning's book Modern Java in Action: Lambdas, streams, reactive and functional programming.
Streams also support a method called distinct that returns a stream with unique elements (according to the implementation of the hashcode and equals methods of the objects produced by the stream). For example, the following code filters all even numbers from a list and then eliminates duplicates (using the equals method for the comparison). Figure 5.2 shows this visually.
List<Integer> numbers = Arrays.asList(1, 2, 1, 3, 3, 2, 4); numbers.stream() .filter(i -> i % 2 == 0) .distinct() .forEach(System.out::println); !@%STYLE%@! {"css":"{\"css\": \"font-weight: bold;\"}","target":"[[{\"line\":3,\"ch\":7},{\"line\":3,\"ch\":18}]]"} !@%STYLE%@!

This is an excerpt from Manning's book Java 8 in Action: Lambdas, streams, and functional-style programming.
Streams also support a method called distinct that returns a stream with unique elements (according to the implementation of the hashCode and equals methods of the objects produced by the stream). For example, the following code filters all even numbers from a list and makes sure that there are no duplicates. Figure 5.2 shows this visually: