Looks like `Long.compare()` only appeared in JDK 1.7, so I'll have to "inline" it.