ClassifierFactory<LookupElement> (final LookupElementWeigher weigher) { final String id = weigher.toString(); return new ClassifierFactory<>(id) { @Override public Classifier<LookupElement> createClassifier(Classifier<LookupElement> next) { return new CachingComparingClassifier(next, weigher); } }; }