code: protected void updateGroups(final LoginContext _login,
                                  final Person _person)
          throws EFapsException
      {
          for (final JAASSystem system : JAASSystem.getAllJAASSystems()) {
              if (system.getGroupJAASPrincipleClass() != null) {
                  final Set<?> groupsJaas = _login.getSubject().getPrincipals(system.getGroupJAASPrincipleClass());
                  final Set<Group> groupsEfaps = new HashSet<>();
                  for (final Object groupObj : groupsJaas) {
                      try {
                          final String groupKey = (String) system.getGroupMethodKey().invoke(groupObj);
                          final Group groupEfaps = Group.getWithJAASKey(system, groupKey);
                          if (groupEfaps != null) {
                              groupsEfaps.add(groupEfaps);
                          }
                      } catch (final IllegalAccessException e) {
                          LoginHandler.LOG.error("could not execute group key method for system " + system.getName(), e);
                      } catch (final IllegalArgumentException e) {
                          LoginHandler.LOG.error("could not execute group key method for system " + system.getName(), e);
                      } catch (final InvocationTargetException e) {
                          LoginHandler.LOG.error("could not execute group key method for system " + system.getName(), e);
                      }
                  }
                  _person.setGroups(system, groupsEfaps);
              }
          }
      }
docs: The groups of the given person are updated with the information from the
  JAAS login context.
  
  @param _login    JAAS login context
  @param _person   person for which the groups must be updated
  @throws EFapsException if a method of the principals inside the JAAS
  login contexts could not be executed or the
  groups for the given person could not be set.