private boolean isSameGroup(@NotNull WindowTabsComponent anotherComponent) {
    if (this == anotherComponent) {
      return true;
    }

    int count = getTabCount();
    if (count != anotherComponent.getTabCount()) {
      return false;
    }

    Set<Object> tabs = new HashSet<>();
    Set<Object> anotherTabs = new HashSet<>();

    for (int i = 0; i < count; i++) {
      tabs.add(getTabAt(i).getObject());
      anotherTabs.add(anotherComponent.getTabAt(i).getObject());
    }

    return tabs.equals(anotherTabs);
  }
private boolean isSameGroup(@NotNull WindowTabsComponent anotherComponent)