public boolean removeTabFromFrame(@NotNull IdeFrameImpl tab) {
    int count = getTabCount();
    boolean removed = false;

    for (int i = 0; i < count; i++) {
      TabInfo info = getTabAt(i);
      if (info.getObject() == tab) {
        removeTitleListener(info);
        removeTab(info);
        recalculateIndexes();
        removed = true;
        count--;
        break;
      }
    }
    return removed && count == 1;
  }
public boolean removeTabFromFrame(@NotNull IdeFrameImpl tab)