Collections.sort(dataList,new Comparator<BaseTransitData>(){ public int compare(BaseTransitData arg0, BaseTransitData arg1) { return arg0.getTransitcode().compareTo(arg1.getTransitcode()); } });