// Check for null and ensure exactly the same class - not subclass.
if (null == obj || getClass() != obj.getClass()) {
return false;
}
Bag bag = (Bag) obj;
boolean returnValue = false;
if (size() == bag.size()) {
List<ObjectNode> myValues = asList(toArray(new ObjectNode[size()]));
List<ObjectNode> altValues = asList(bag.toArray(new ObjectNode[size()]));
returnValue = myValues.equals(altValues);
}
return returnValue;
}