RunAnythingGroup (@NotNull List<? extends RunAnythingGroup> groups, int itemIndex) { RunAnythingGroup runAnythingGroup = null; for (RunAnythingGroup group : groups) { if (group.myTitleIndex == -1) { continue; } if (group.myTitleIndex > itemIndex) { break; } runAnythingGroup = group; } return runAnythingGroup; }