It is better to use Integer.compare instead of writing these manually.