boolean (Object obj) { if (!(obj instanceof ClientPropertiesManager rhs)) { return false; } if (rhs.myPropertyMap.size() != myPropertyMap.size()) { return false; } for(Map.Entry<String, List<ClientProperty>> entry: myPropertyMap.entrySet()) { List<ClientProperty> rhsList = rhs.myPropertyMap.get(entry.getKey()); if (rhsList == null || rhsList.size() != entry.getValue().size()) { return false; } for(ClientProperty prop: entry.getValue()) { if (!rhsList.contains(prop)) { return false; } } } return true; }