private static boolean isAcceptedField(PsiElement element) {
    return element instanceof PsiField &&
           element.getLanguage().isKindOf(JavaLanguage.INSTANCE) &&
           ((PsiField)element).getContainingClass() != null;
  }
private static boolean isAcceptedField(PsiElement element)