public static boolean isInStaticContext(PsiElement element, final @Nullable PsiClass aClass) {
    return PsiUtil.getEnclosingStaticElement(element, aClass) != null;
  }
public static boolean isInStaticContext(PsiElement element, final @Nullable PsiClass aClass)