code: protected Authorizable makeGroupAvailable(@Nonnull final Session session,
                                                @Nonnull final String id, @Nonnull final String intermediatePath)
              throws RepositoryException {
          UserManager userManager = ((JackrabbitSession) session).getUserManager();
          Authorizable authorizable = userManager.getAuthorizable(id);
          if (authorizable != null) {
              if (authorizable.isGroup()) {
                  return authorizable;
              }
              throw new RepositoryException("'" + id + "' exists but is not a group");
          }
          LOG.info("addGroup({},{})", id, intermediatePath);
          try {
              authorizable = userManager.createGroup(new Principal() {
                  @Override
                  public String getName() {
                      return id;
                  }
              }, intermediatePath);
          session.save();
          } catch (RepositoryException e) {
              LOG.error("Error in makeGroupAvailable({},{}) : {}", new Object[]{id, intermediatePath, e.toString()});
              throw e;
          }
          return authorizable;
      }
docs: groups