I have two lists of arrays.
How do I easily compare equality of these with Java 8 and its features, without using external libraries? I am looking for a \"bett
using zip
(which originates from lambda b93) function from https://stackoverflow.com/a/23529010/755183, code could look like:
boolean match = a.size() == b.size() &&
zip(a.stream(), b.stream(), Arrays::deepEquals).
allMatch(equal -> equal)
in order to check size of arrays first and then content this could be a solution to consider
final boolean match = a.size() == b.size()
&& zip(a.stream(), b.stream(), (as, bs) -> as.length == bs.length).
allMatch(equal -> equal)
&& zip(a.stream(), b.stream(), Arrays::deepEquals).
allMatch(equal -> equal);