### Question:
MatchExpression implements Expression, PipeExpression { @Override public ExpressionResult apply(ExpressionContext context, ExpressionResult input) { ExpressionResult value = valueExpression.apply(context, input); if( value == null || ! value.isNonNull() ) return BooleanExpressionResult.forValue(false); ExpressionResult pattern = patternExpression.apply(context, input); return BooleanExpressionResult.forValue(value.toString().matches(pattern.toString())); } MatchExpression(String alias, Expression[] expressions); @Override ExpressionResult apply(ExpressionContext context, ExpressionResult input); @Override String alias(); @Override boolean process(ExpressionContext context, QueryResult result, Pipeline next); @Override List<String> getColumnNames(List<String> inputColumns);  }### Answer:
@Test public void normalMatch() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue("value", stringValue("abcdefg"), "pattern", stringValue("a.*g"))); assertTrue( actual.isTrue()); }
@Test public void nonMatch() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue("value", stringValue("abcdefg"), "pattern", stringValue("b.*g"))); assertFalse( actual.isTrue()); }
@Test public void nullMatch() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue( "pattern", stringValue("b.*g"))); assertFalse( actual.isTrue()); }