最佳答案
Collectors.toSet()
does not preserve order. I could use Lists instead, but I want to indicate that the resulting collection does not allow element duplication, which is exactly what Set
interface is for.