static @Nullable Map<Long, ActionGroup> getActionGroup(@NotNull String groupId) {
    // 1. build full name of group
    final String fullGroupId = groupId.startsWith(IdeActions.GROUP_TOUCHBAR) ? groupId : IdeActions.GROUP_TOUCHBAR + groupId;

    // 2. read touchbar-actions from CustomActionsSchema and select proper child
    final ActionGroup allTouchbarActions = (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(IdeActions.GROUP_TOUCHBAR);
    if (allTouchbarActions == null) {
      LOG.debug("can't create touchbar because ActionGroup isn't defined: %s", IdeActions.GROUP_TOUCHBAR);
      return null;
    }

    final ActionManager actionManager = ActionManager.getInstance();
    ActionGroup actionGroup = null;
    for (AnAction act : allTouchbarActions.getChildren(null)) {
      if (!(act instanceof ActionGroup)) {
        continue;
      }
      String actId = actionManager.getId(act instanceof CustomisedActionGroup o ? o.getDelegate() : act);
      if (actId == null || actId.isEmpty()) {
        continue;
      }

      if (actId.equals(fullGroupId)) {
        actionGroup = (ActionGroup)act;
        break;
      }
    }

    // 3. when group wasn't found in CustomActionsSchema just read group from ActionManager
    if (actionGroup == null) {
      LOG.debug("group %s wasn't found in CustomActionsSchema, will obtain it directly from ActionManager", groupId);
      final AnAction act = actionManager.getAction(fullGroupId);
      if (!(act instanceof ActionGroup)) {
        LOG.debug("can't create touchbar because corresponding ActionGroup isn't defined: %s", groupId);
        return null;
      }
      actionGroup = (ActionGroup)act;
    }

    // 4. extract main layout and alternative layouts with modifers
    Map<Long, ActionGroup> result = new HashMap<>();
    final DefaultActionGroup mainLayout = new DefaultActionGroup();
    mainLayout.getTemplatePresentation().copyFrom(actionGroup.getTemplatePresentation()); // just for convenience debug
    result.put(0L, mainLayout);
    for (AnAction act : actionGroup.getChildren(null)) {
      if (!(act instanceof ActionGroup)) {
        mainLayout.addAction(act);
        continue;
      }
      String gid = actionManager.getId(act instanceof CustomisedActionGroup o ? o.getDelegate() : act);
      if (gid.startsWith(fullGroupId + "_")) {
        final long mask = _str2mask(gid.substring(fullGroupId.length() + 1));
        if (mask != 0) {
          result.put(mask, (ActionGroup)act);
        } else {
          LOG.debug("zero mask for group: %s", fullGroupId);
        }
      } else {
        mainLayout.addAction(act);
      }
    }

    return result;
  }
static @Nullable Map<Long, ActionGroup> getActionGroup(@NotNull String groupId)