Integer.compare requires Java7, move methods to Misc