Java 6 compatibility fix

Integer.compare is available in Java 7+
Merge pull request #82 from neykov/fix/jdk6-compatibility

Java 6 compatibility fix