PsiElement (@Nullable List<? extends RatedResolveResult> resolveResults) { if (!ContainerUtil.isEmpty(resolveResults)) { return Collections.max(resolveResults, Comparator.comparingInt(RatedResolveResult::getRate)).getElement(); } return null; }