Usage (@NotNull Collection<? extends Usage> toDelete) { ThreadingAssertions.assertEventDispatchThread(); Usage toSelect = null; for (Usage usage : toDelete) { Usage next = getNextToSelect(usage); if (next != null && !toDelete.contains(next)) { toSelect = next; break; } } return toSelect; }