private static boolean isPotentialShortIf(PsiElement statement) {
    while (true) {
      // JLS 14.5
      if (statement instanceof PsiLabeledStatement) {
        statement = ((PsiLabeledStatement)statement).getStatement();
      }
      else if (statement instanceof PsiForStatement || statement instanceof PsiForeachStatement || statement instanceof PsiWhileStatement) {
        statement = ((PsiLoopStatement)statement).getBody();
      }
      else break;
    }
    return statement instanceof PsiIfStatement;
  }
private static boolean isPotentialShortIf(PsiElement statement)