Description
TransformedMultiValuedMap.equals() does not return true when comparing a value of a Collection key with itself. Is it allowed to put Collection as a key in TransformedMultiValuedMap at all? If not, I think it should be specified in the document. Or, equals() should be fixed accordingly.
Reproduce step
Test.java
public void test() { TransformedMultiValuedMap map = TransformedMultiValuedMap.transformingMap((MultiValuedMap)new MultiValuedHashMap(),TransformerUtils.stringValueTransformer(), TransformerUtils.stringValueTransformer()); MultiValuedHashMap helperMap = new MultiValuedHashMap(); helperMap.put("KEY", "Value"); Collection key = helperMap.keySet(); map.put(key, "Hi"); Collection value = map.get(key); assertTrue("Contract failed: value.equals(value)", value.equals(value)); }
Attachments
Issue Links
- is part of
-
COLLECTIONS-543 AbstractCollectionDecorator should not delegate equals and hashcode
- Closed