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
One way is to get the name of the first list and call allMatch and check against that.
allMatch
String firstName = yourListOfAs.get(0).name; boolean allSameName = yourListOfAs.stream().allMatch(x -> x.name.equals(firstName));