void (Collection<SearchEverywhereContributor<?>> retainContributors) { Iterator<SearchEverywhereFoundElementInfo> iterator = listElements.iterator(); int startInterval = 0; int endInterval = -1; while (iterator.hasNext()) { SearchEverywhereFoundElementInfo item = iterator.next(); if (retainContributors.contains(item.getContributor())) { if (startInterval <= endInterval) { fireIntervalRemoved(this, startInterval, endInterval); startInterval = endInterval + 2; } else { startInterval++; } } else { iterator.remove(); } endInterval++; } if (startInterval <= endInterval) { fireIntervalRemoved(this, startInterval, endInterval); } }