code: @Override
      public List<String> getGroupsForUser(String userSecurityName) throws EntryNotFoundException, RegistryException {
          if (userSecurityName == null) {
              throw new IllegalArgumentException("userSecurityName is null");
          }
          if (userSecurityName.isEmpty()) {
              throw new IllegalArgumentException("userSecurityName is an empty String");
          }
  
          if (!isValidUser(userSecurityName)) {
              throw new EntryNotFoundException(userSecurityName + " does not exist");
          }
  
          List<String> matched = new ArrayList<String>();
          Set<String> groupNames = state.groups.keySet();
          Iterator<String> itr = groupNames.iterator();
          while (itr.hasNext()) {
              String groupName = itr.next();
              if (state.groups.get(groupName).contains(userSecurityName)) {
                  matched.add(groupName);
              }
          }
  
          return matched;
      }
docs: TODO this doesn't work for case insensitive