SyntaxFix
Write A Post
Hire A Developer
Questions
The Most simple code you can write:
persons.stream().map(x-> x.getName()).distinct().collect(Collectors.toList());