How about do not call get twice. It might be expensive for sparse entries. Like this:

```java
double value = get(i, j);
if (value > max) {
  max = value;
}
```