Fix java 6 regression introduced by 0fcb80561cd9a5b3e7032224a1efd8749ee21b0d

I think we are still targeting Java 6. Long.compare(long, long) has been added in Java 7. 

What do you think about creating a  [Travis CI](http://travis-ci.org) job to check that the build is always green in Java 6/7/8 ?