private static void ensureValidPsi(@NotNull ResolveResult resolveResult) {
    PsiElement element = resolveResult.getElement();
    if (element != null) {
      PsiUtilCore.ensureValid(element);
    }
  }
private static void ensureValidPsi(@NotNull ResolveResult resolveResult)