use Character.compareTo for jdk 6 and below