code: private void setUserGroupNames(String userName, String[] groupNames) {
      if (userName==null || userName.length()==0 ||
          groupNames== null || groupNames.length==0) {
        throw new IllegalArgumentException(
            "Parameters should not be null or an empty string/array");
      }
      for (int i=0; i<groupNames.length; i++) {
        if(groupNames[i] == null || groupNames[i].length() == 0) {
          throw new IllegalArgumentException("A null group name at index " + i);
        }
      }
      this.userName = userName;
      this.groupNames = groupNames;
    }
docs: /* Set this object's user name and group names
  
  @param userName a user's name
  @param groupNames groups list, the first of which is the default group
  @exception IllegalArgumentException if any argument is null