private static boolean canBeStatic(PsiElement statement) {
    PsiElement parent = statement.getParent();
    while (parent != null && !(parent instanceof PsiFile)) {
      if (parent instanceof GrMember) {
        return ((GrMember) parent).hasModifierProperty(PsiModifier.STATIC);
      }
      parent = parent.getParent();
    }
    return false;
  }
private static boolean canBeStatic(PsiElement statement)