public int compare(Object a, Object b) { return (new String(a.toCharArray().reverse())).compareTo(new String(b.toCharArray().reverse())); }