If you want a guaranteed HashSet, use Collectors.toCollection(HashSet::new).
HashSet
Collectors.toCollection(HashSet::new)