public static boolean isConstructorCall ( Expression expression , String classNamePattern ) { return expression instanceof ConstructorCallExpression && expression . getType ( ) . getName ( ) . matches ( classNamePattern ) ; }
Return true if the expression is a constructor call on a class that matches the supplied .