blob: 6439984dc53086861ecc3d479622428fd600eae5 [file] [log] [blame] [view] [edit]
Implementations of `#equals` should return `false` for different types, not
throw.
```java
class Data {
private int a;
@Override
public boolean equals(Object other) {
Data that = (Data) other; // BAD: This may throw ClassCastException.
return a == that.a;
}
}
```