boolean (List<? extends Attribute> l1, List<? extends Attribute> l2) { if (l1 == null) return l2 == null; if (l2 == null) return false; if (l1.size() != l2.size()) return false; Iterator<? extends Attribute> i1 = l1.iterator(); for (Attribute aL2 : l2) { Attribute attr1 = i1.next(); if (!Objects.equals(attr1.getName(), aL2.getName()) || !Objects.equals(attr1.getValue(), aL2.getValue())) { return false; } } return true; }