I am new to Java 8. I have a list of custom objects of type A, where A is like below:
class A { int id; String name; }
I woul
another way is to calculate count of distinct names using
boolean result = myList.stream().map(A::getName).distinct().count() == 1;
of course you need to add getter for 'name' field