blob: eacfd9fe2d8c8b3cffd683d7d520ece9c7862cb8 [file] [view] [edit]
An equals method compares non-corresponding fields from itself and the other
instance:
```java
class Frobnicator {
private int a;
private int b;
@Override
public boolean equals(@Nullable Object other) {
if (!(other instanceof Frobnicator)) {
return false;
}
Frobnicator that = (Frobnicator) other;
return a == that.a && b == that.a; // BUG: should be b == that.b
}
}
```