Check IfStatement matched pattern :
Object var1;
if (!(var1 instanceOf Runnable)) {
return
}
// Here var1 instance of Runnable
<p>
Return expression , which contains instanceOf (without not)
Return null, if not found
438593
protected BinaryExpression findInstanceOfNotReturnExpression(IfStatement ifElse) {
        Statement elseBlock = ifElse.getElseBlock();
        if (!(elseBlock instanceof EmptyStatement)) {
            return null;
        }
        Expression conditionExpression = ifElse.getBooleanExpression().getExpression();
        if (!(conditionExpression instanceof NotExpression)) {
            return null;
        }
        NotExpression notExpression = (NotExpression) conditionExpression;
        Expression expression = notExpression.getExpression();
        if (!(expression instanceof BinaryExpression)) {
            return null;
        }
        BinaryExpression instanceOfExpression = (BinaryExpression) expression;
        int op = instanceOfExpression.getOperation().getType();
        if (op != Types.KEYWORD_INSTANCEOF) {
            return null;
        }
        if (notReturningBlock(ifElse.getIfBlock())) {
            return null;
        }
        return instanceOfExpression;
    }
770902
static Class<? extends Matcher<? super ExpressionTree>> getValue(Matches matches) {
    String name;
    try {
      matches.value();
      throw new RuntimeException("unreachable");
    } catch (MirroredTypeException e) {
      DeclaredType type = (DeclaredType) e.getTypeMirror();
      name = ((TypeElement) type.asElement()).getQualifiedName().toString();
    }
    try {
      return asSubclass(Class.forName(name), new TypeToken<Matcher<? super ExpressionTree>>() {});
    } catch (ClassNotFoundException | ClassCastException e) {
      throw new RuntimeException(e);
    }
  }
536276
public function matchIfValueReturnValue(If_ $ifNode): ?Expr
    {
        if (count($ifNode->stmts) !== 1) {
            return null;
        }

        $insideIfNode = $ifNode->stmts[0];
        if (! $insideIfNode instanceof Return_) {
            return null;
        }

        /** @var Return_ $returnNode */
        $returnNode = $insideIfNode;

        if (! $ifNode->cond instanceof Identical) {
            return null;
        }

        if ($this->betterStandardPrinter->areNodesEqual($ifNode->cond->left, $returnNode->expr)) {
            return $ifNode->cond->right;
        }

        if ($this->betterStandardPrinter->areNodesEqual($ifNode->cond->right, $returnNode->expr)) {
            return $ifNode->cond->left;
        }

        return null;
    }
331054
private Expression checker(Data data) throws TemplateException {
	Expression expr = null;
	// String
	if ((expr = string(data)) != null) {
	    expr = subDynamic(data, expr, false, false);
	    data.mode = STATIC;// (expr instanceof Literal)?STATIC:DYNAMIC;// STATIC
	    return expr;
	}
	// Number
	if ((expr = number(data)) != null) {
	    expr = subDynamic(data, expr, false, false);
	    data.mode = STATIC;// (expr instanceof Literal)?STATIC:DYNAMIC;// STATIC
	    return expr;
	}
	// closure
	if ((expr = closure(data)) != null) {
	    data.mode = DYNAMIC;
	    return expr;
	}
	// lambda
	if ((expr = lambda(data)) != null) {
	    data.mode = DYNAMIC;
	    return expr;
	}

	// Dynamic
	if ((expr = dynamic(data)) != null) {
	    expr = newOp(data, expr);
	    expr = subDynamic(data, expr, true, false);
	    data.mode = DYNAMIC;
	    return expr;
	}
	// Sharp
	if ((expr = sharp(data)) != null) {
	    data.mode = DYNAMIC;
	    return expr;
	}
	// JSON
	if ((expr = json(data, JSON_ARRAY, '[', ']')) != null) {
	    expr = subDynamic(data, expr, false, false);
	    data.mode = DYNAMIC;
	    return expr;
	}
	if ((expr = json(data, JSON_STRUCT, '{', '}')) != null) {
	    expr = subDynamic(data, expr, false, false);
	    data.mode = DYNAMIC;
	    return expr;
	}
	// else Error
	throw new TemplateException(data.srcCode, "Syntax Error, Invalid Construct");
    }
122963
private TemplateExpression processJavaExpression(String expressionString) {
    Expression expression;
    try {
      expression = JavaParser.parseExpression(expressionString);
    } catch (ParseProblemException parseException) {
      logger.error("Couldn't parse Expression, make sure it is valid Java.",
          expressionString);
      throw parseException;
    }

    resolveTypesUsingImports(expression);
    resolveStaticMethodsUsingImports(expression);

    checkMethodNames(expression);

    // Find the parameters used by the expression
    List<VariableInfo> expressionParameters = new LinkedList<>();
    findExpressionParameters(expression, expressionParameters);

    // If there is a cast first, we use this as the type of our expression
    if (currentProp == null) {
      expression = getTypeFromCast(expression);
    }

    // Update the expression as it might have been changed
    expressionString = expression.toString();

    // Add the resulting expression to our result
    return result.addExpression(expressionString,
        currentExpressionReturnType,
        currentProp == null,
        expressionParameters);
  }
1298669
public boolean isIndexed(String expression) {
    if (expression == null || expression.length() == 0) { return false; }
    for (int i = 0; i < expression.length(); i++) {
      char c = expression.charAt(i);
      if (c == Nested || c == MappedStart) {
        return false;
      } else if (c == IndexedStart) { return true; }
    }
    return false;
  }
578975
static boolean isExpression(String expression) {

        if (null == expression) {
            return false;
        }

        //check to see if attribute has an expression
        int start = expression.indexOf("#{");
        return start != -1 && expression.indexOf('}', start+2) != -1;
    }
180562
private String processVariableStatements(String control, String result, TestContext context) {
        if (control.equals(Citrus.IGNORE_PLACEHOLDER)) {
            return control;
        }

        Pattern whitespacePattern = Pattern.compile("[^a-zA-Z_0-9\\-\\.]");
        Pattern variablePattern = Pattern.compile("@variable\\(?'?([a-zA-Z_0-9\\-\\.]*)'?\\)?@");

        Matcher variableMatcher = variablePattern.matcher(control);
        while (variableMatcher.find()) {
            String actualValue = result.substring(variableMatcher.start());
            Matcher whitespaceMatcher = whitespacePattern.matcher(actualValue);
            if (whitespaceMatcher.find()) {
                actualValue = actualValue.substring(0, whitespaceMatcher.start());
            }

            control = variableMatcher.replaceFirst(actualValue);
            context.setVariable(variableMatcher.group(1), actualValue);
            variableMatcher = variablePattern.matcher(control);
        }

        return control;
    }
785828
StatementSimple compileSetStatement(RangeVariable rangeVars[]) {

        read();

        OrderedHashSet colNames = new OrderedHashSet();
        HsqlArrayList  exprList = new HsqlArrayList();

        readSetClauseList(rangeVars, colNames, exprList);

        if (exprList.size() > 1) {
            throw Error.error(ErrorCode.X_42602);
        }

        Expression expression = (Expression) exprList.get(0);

        if (expression.getDegree() != colNames.size()) {

//            throw Error.error(ErrorCode.X_42546);
        }

        int[]          indexes   = new int[colNames.size()];
        ColumnSchema[] variables = new ColumnSchema[colNames.size()];

        setVariables(rangeVars, colNames, indexes, variables);

        HsqlList unresolved = expression.resolveColumnReferences(rangeVars,
            rangeVars.length, null, false);

        unresolved = Expression.resolveColumnSet(rangeVars, unresolved, null);

        ExpressionColumn.checkColumnsResolved(unresolved);
        expression.resolveTypes(session, null);

        StatementSimple cs = new StatementSimple(StatementTypes.ASSIGNMENT,
            variables, expression, indexes);

        return cs;
    }
688407
private boolean checkSimpleExpression(String tagExpression, List<String> scenarioTags) {
        Set<String> expressionTags = extractTagsFromSimpleExpression(tagExpression);

        for (String expressionTag : expressionTags) {
            if (expressionTag.startsWith("@")) {
                if (!scenarioTags.contains(expressionTag)) {
                    //this tag is not listed on the scenario so don't execute
                    return false;
                }
            } else if (expressionTag.startsWith("!")) {
                String expressionTagWithoutNot = expressionTag.substring(1, expressionTag.length());
                if (scenarioTags.contains(expressionTagWithoutNot)) {
                    //this is a negated tag and it exists on the scenario so don't execute
                    return false;
                }
            } else {
                throw new IllegalStateException(String.format("'%s' is not a valid tag, no @ or !@ prefix", expressionTag));
            }
        }

        //there are no reasons left for not executing
        return true;
    }
951374
private static ExpressionTree getNullCheckedExpression(ExpressionTree condition) {
    condition = stripParentheses(condition);
    if (!(condition instanceof BinaryTree)) {
      return null;
    }
    BinaryTree bin = (BinaryTree) condition;
    ExpressionTree other;
    if (bin.getLeftOperand().getKind() == Kind.NULL_LITERAL) {
      other = bin.getRightOperand();
    } else if (bin.getRightOperand().getKind() == Kind.NULL_LITERAL) {
      other = bin.getLeftOperand();
    } else {
      return null;
    }
    return other;
  }
193689
public static @Nonnull Predicate evaluating(final @Nonnull String pattern) {
        return new Predicate() {
            @Override
            public boolean isValid(@Nonnull ProcessThread<?, ?, ?> thread) {
                for (StackTraceElement element : thread.getStackTrace().getElements()) {
                    if ((element.getClassName() + "." + element.getMethodName()).equals(pattern)) return true;
                }
                return false;
            }
        };
    }
118132
private boolean checkCondition(TestContext context) {
        if (conditionExpression != null) {
            return conditionExpression.evaluate(context);
        }

        // replace dynamic content with each iteration
        String conditionString = context.replaceDynamicContentInString(condition);
        if (ValidationMatcherUtils.isValidationMatcherExpression(conditionString)) {
            try {
                ValidationMatcherUtils.resolveValidationMatcher("iteratingCondition", "", conditionString, context);
                return true;
            } catch (AssertionError e) {
                return false;
            }
        }

        return BooleanExpressionParser.evaluate(conditionString);
    }
1132724
@Deprecated
    public C verifyAtLeast(int allowedStatements, Threads threadMatcher) throws WrongNumberOfQueriesError {
        return verify(SqlQueries.minQueries(allowedStatements).threads(threadMatcher));
    }
1260559
public static boolean isExpressionContainPattern(String expression, String pattern) {
		
		try {
			
			// Si la chaine est vide : false
			if(expression == null || expression.trim().length() == 0) {
				
				// On retourne false
				return false;
			}
			
			// Construction d'un Pattern
			Pattern regex = Pattern.compile(".*" + pattern + ".*");
			
			// On retourne le resultat
			return regex.matcher(expression).matches();
			
		} catch (PatternSyntaxException e) {
			
			// On leve l'exception relative
			throw new RuntimeException(pattern, e);
		}
	}
230152
@Override
    public boolean matches(Object obj) {
        if (!(obj instanceof Throwable))
            return false;

        Throwable throwable = (Throwable) obj;

        return throwable.getCause() == null;
    }
109293
public static BooleanExpression anyOf(BooleanExpression... exprs) {
        BooleanExpression rv = null;
        for (BooleanExpression b : exprs) {
            rv = rv == null ? b : rv.or(b);
        }
        return rv;
    }