I have a list which contains duplicates & need to remove them. My list is of the form
List<List<XSSFCell>> results;
A sample of data stored in the List 'results' is:
- [ABC, 123, 22-Apr-2016]
- [DEF, 456, 22-Apr-2016]
- [ABC, 123, 22-Apr-2016]
- [ABC, 123, 10-Jan-2016]
Based on this Link I tried the below code:
Set<List<XSSFCell>> hashSetResults = new LinkedHashSet<>(results);
Expected output is:
- [ABC, 123, 22-Apr-2016]
- [DEF, 456, 22-Apr-2016]
- [ABC, 123, 10-Jan-2016]
But it is not removing the duplicate & the entire list gets saved in the Set. Hope am clear on the issue faced, seek guidance.