Iterable<LookupElement> (@NotNull Iterable<? extends LookupElement> source, final @NotNull ProcessingContext context) { List<LookupElement> initialList; Collection<List<LookupElement>> byWeight; synchronized (this) { initialList = getInitialNoStatElements(source, context); Iterable<LookupElement> rest = withoutInitial(source, initialList); byWeight = buildMapByWeight(rest).descendingMap().values(); } return JBIterable.from(initialList).append(JBIterable.from(byWeight).flatten(group -> myNext.classify(group, context))); }