int (@Nullable Condition<? super AnAction> preselectActionCondition, @NotNull List<? extends PopupFactoryImpl.ActionItem> items) { int defaultOptionIndex = 0; if (preselectActionCondition != null) { for (int i = 0; i < items.size(); i++) { final AnAction action = items.get(i).getAction(); if (preselectActionCondition.value(action)) { defaultOptionIndex = i; break; } } } return defaultOptionIndex; }