fixed equals() method in ModifyAware collections.

This commit is contained in:
Roland Praml
2019-05-08 16:45:02 +02:00
parent 2648423930
commit 662f9cdeb3
3 changed files with 22 additions and 9 deletions
@@ -55,9 +55,13 @@ public class ModifyAwareSet<E> implements Set<E>, ModifyAwareOwner {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ModifyAwareSet)) return false;
ModifyAwareSet<?> that = (ModifyAwareSet<?>) o;
return Objects.equals(set, that.set);
if (o instanceof ModifyAwareSet) {
ModifyAwareSet<?> that = (ModifyAwareSet<?>) o;
return Objects.equals(set, that.set);
}
if (!(o instanceof Set)) return false;
Set<?> that = (Set<?>) o;
return Objects.equals(set, that);
}
@Override