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