Maybe this should even be
```java
if (Double.isNaN(v1)) {
    if (Double.isNaN(v2)) {
        return 0;
    } else {
        return 1;
    }
}
```