void (Usage @NotNull [] usages, @NotNull UsageView usageView) { ThreadingAssertions.assertEventDispatchThread(); if (usages.length == 0) return; Arrays.sort(usages, UsageViewImpl.USAGE_COMPARATOR_BY_FILE_AND_OFFSET); final Usage nextToSelect = getNextToSelect(usageView, usages[usages.length - 1]); usageView.removeUsagesBulk(Arrays.asList(usages)); if (nextToSelect != null) { usageView.selectUsages(new Usage[]{nextToSelect}); } }