(Object o)
| 19 | } |
| 20 | |
| 21 | @Override |
| 22 | public boolean equals(Object o) { |
| 23 | if (this == o) return true; |
| 24 | if (!(o instanceof UnorderedPair)) return false; |
| 25 | |
| 26 | UnorderedPair<?> that = (UnorderedPair<?>) o; |
| 27 | |
| 28 | if (compare(first, that.first) && compare(second, that.second)) return true; |
| 29 | if (compare(second, that.first) && compare(first, that.second)) return true; |
| 30 | return false; |
| 31 | } |
| 32 | |
| 33 | private boolean compare(Object a, Object b) { |
| 34 | if (a == null) return b != null; |