I have a List of class A objects with multiple fields including number1 & number2 apart from various others.
I want to extract all the unique number1 & number2 values from the List<A> via java 8 Streams.
The map function helps me get only 1 field like below:
list.stream().map(A::getNumber1);
And after the above code gets executed, there is no way to extract number2. How can I do this?