protected void extractRoles(HiOrgServerProfile profile) {
        final Integer rolesAsInt = profile.getRolesAsInteger();
        Set<String> roles = new HashSet<>();
        for (var i = 0; i <= 10; i++) {
            var groupId = (int) Math.pow(2, i);
            var isGroupSet = (rolesAsInt & groupId) == groupId;
            if (isGroupSet) {
                logger.debug("Extracted role " + groupId);
                roles.add(String.valueOf(groupId));
            }
        }
        profile.setRoles(roles);
    }
<p>extractRoles.</p>

@param profile a {@link HiOrgServerProfile} object
pac4j-oauth/src/main/java/org/pac4j/oauth/profile/hiorgserver/HiOrgServerProfileDefinition.java