Take the following line of sample code:
Set someSet = someColletion.stream().map(p -> p.toString()).collect(Collectors.toSet());
If you want a guaranteed HashSet, use Collectors.toCollection(HashSet::new).
HashSet