docs: private Set<IGroupMember> toGroupMembers(List<String> groupNames, String fname) {
          final Set<IGroupMember> groups = new HashSet<>();
          for (String groupName : groupNames) {
              // Assumes the groupName case matches the DB values.
              EntityIdentifier[] gs =
                      GroupService.searchForGroups(
                              groupName, IGroupConstants.SearchMethod.DISCRETE, IPerson.class);
              IGroupMember group;
              if (gs != null && gs.length > 0) {
                  group = GroupService.findGroup(gs[0].getKey());
              } else {
                  // An actual group key might be specified, so try looking up group directly
                  group = GroupService.findGroup(groupName);
              }
  
              if (group == null) {
                  throw new IllegalArgumentException(
                          "No group '" + groupName + "' found when importing portlet: " + fname);
              }
  
              groups.add(group);
          }
  
          return groups;
      }