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