1List<String> distinctElements = list.stream()
2 .distinct()
3 .collect(Collectors.toList());
1public Set<String> areas(final List<Employee> employees) {
2 Set<String> areas = new HashSet<>();
3 for(final Employee employee: employees) {
4 areas.add(employee.getArea());
5 }
6 return areas;
7}
8