class DomainRoleMembersFetcherCommon {

    public Set<String> getDomainRoleMembers(String roleName, List<Role> roles) {
        if (roles == null) {
            return new HashSet<>();
        }

        for (Role role : roles) {
            if (role.getName() == null) {
                continue;
            }

            if (role.getName().equals(roleName)) {
                if (role.getRoleMembers() == null) {
                    return new HashSet<>();
                }

                return role.getRoleMembers().stream()
                        .filter(this::isUnexpiredUser)
                        .map(RoleMember::getMemberName).collect(Collectors.toSet());
            }
        }

        return new HashSet<>();
    }

    public  DomainRoleMembersFetcherCommon(String userDomainPrefix);

}