void (Set<? super LookupElement> model, Iterator<? extends LookupElement> iterator, Predicate<? super LookupElement> stopWhen) { while (iterator.hasNext()) { LookupElement item = iterator.next(); model.add(item); if (stopWhen.test(item)) { break; } } }