how to remove duplicate item from arraylist in java using comparator
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);