code/app/be/objectify/deadbolt/java/DeadboltAnalyzer.java
public List<String> getRoleNames(final Optional<? extends Subject> subjectOption)
    {
        final List<String> roleNames = new ArrayList<>();
        subjectOption.ifPresent(subject ->
                                {
                                    final List<? extends Role> roles = subject.getRoles();
                                    if (roles != null)
                                    {
                                        roleNames.addAll(roles.stream()
                                                              .filter(Objects::nonNull)
                                                              .map(Role::getName)
                                                              .collect(Collectors.toList()));
                                    }
                                });

        return roleNames;
    }
public List<String> getRoleNames(final Optional<? extends Subject> subjectOption)
    {
        final List<String> roleNames = new ArrayList<>();
        subjectOption.ifPresent(subject ->
                                {
                                    final List<? extends Role> roles = subject.getRoles();
                                    if (roles != null)
                                    {
                                        roleNames.addAll(roles.stream()
                                                              .filter(Objects::nonNull)
                                                              .map(Role::getName)
                                                              .collect(Collectors.toList()));
                                    }
                                });

        return roleNames;
    }
Gets the role name of each role held.

@param subjectOption an option for the subject
@return a non-null list containing all role names