void (boolean showPopup) { rebuildAndSelectItem((list) -> { if (UISettings.getInstance().getShowMembersInNavigationBar()) { int lastDirectory = ContainerUtil.lastIndexOf(list, (item) -> NavBarPanel.isExpandable(item.getObject())); if (lastDirectory >= 0 && lastDirectory < list.size() - 1) return lastDirectory; } return list.size() - 1; }, showPopup); }