I need to have original list of data and changed list of data when I distinct it.
For exmaple :
List<Marketing_Points> userPointList = new ArrayList<>();
userPointList = /*Add a list of data */
Set<Marketing_Points> distinct = new HashSet<>();
Simply create a
dummy list and
add all elements of original list to it and then you can use either of them to create a distinct list(though should use dummy list).
although Set doesn't allow duplicate value so if you have any duplicate value in list then it won't be added to Set(i guess u know this ) so keep a copy of original list to use later