Long.signum(cmp)
http://docs.oracle.com/javase/7/docs/api/java/lang/Long.html#signum(long)