Set<FilterModel> set = new TreeSet<>(new Comparator<FilterModel>() { @Override public int compare(FilterModel o1, FilterModel o2) { if (o1.getFtype().equalsIgnoreCase(o2.getFtype())) { return 0; } return 1; } });  set.addAll(filterlist); filterlist.clear(); filterlist.addAll(set); 

Read more of this post