How can we remove duplicates from List with the help of Guava api?
Currently I am following this:
private List removeDuplic
with generic predicate
class DuplicateRemover implements Predicate { private final Set set = new HashSet<>(); @Override public boolean apply(T input) { boolean flag = set.contains(input); if (!flag) { set.add(input); } return !flag; } }