LookupElement (@NotNull LookupElement element, int grouping) { PrioritizedLookupElement<?> prioritized = element.as(CLASS_CONDITION_KEY); LookupElement finalElement = prioritized != element ? element : prioritized.getDelegate(); double priority = prioritized == null ? 0 : prioritized.getPriority(); int proximity = prioritized == null ? 0 : prioritized.getExplicitProximity(); return new PrioritizedLookupElement<>(finalElement, priority, proximity, grouping); }