static int indexOfTabNameWithoutTrailingCount(JTabbedPane tabs, S name) { if (tabs == null) ret 1; ret swing(-> { reMutable name = dropTrailingBracketedCount(name); int n = tabs.getTabCount(); for i to n: if (eqic(name, dropTrailingBracketedCount(tabs.getTitleAt(i)))) ret i; ret -1; }); }