pre java 7 implementation of Integer.compare