boolean (Object o) { if (o == this) { return true; } if (!(o instanceof List) || size() != ((List<?>)o).size()) { return false; } if (size() == 0) { return true; } if (o instanceof ImmutableSameTypeAttributeList) { ImmutableSameTypeAttributeList io = (ImmutableSameTypeAttributeList)o; return myType == io.myType && myNs.equals(io.myNs) && Arrays.equals(myNameValues, io.myNameValues); } List<Attribute> l = (List<Attribute>)o; for (int i = 0; i < myNameValues.length; i += 2) { String name = myNameValues[i]; String value = myNameValues[i + 1]; Attribute a2 = l.get(i / 2); if (!Objects.equals(name, a2.getName()) || !Objects.equals(value, a2.getValue()) || !Comparing.equal(myType, a2.getAttributeType()) || !Comparing.equal(myNs, a2.getNamespace()) ) { return false; } } return true; }