private static PsiElement findJavaCodeUpThere(PsiElement element) {
    InjectedLanguageManager injectedManager = InjectedLanguageManager.getInstance(element.getProject());
    while (element != null) {
      if (element.getLanguage() == JavaLanguage.INSTANCE && !injectedManager.isInjectedFragment(element.getContainingFile())) return element;
      element = element.getContext();
    }
    return null;
  }
private static PsiElement findJavaCodeUpThere(PsiElement element)