Use Collectors.toSet
:
Set<String> results = someDao.findByType(type)
.stream()
.map(ClassName::getValue)
.collect(Collectors.toSet());
Use Collectors.toSet
:
Set<String> results = someDao.findByType(type)
.stream()
.map(ClassName::getValue)
.collect(Collectors.toSet());