### Question:
FormatDateExpression implements Expression, PipeExpression { @Override public ExpressionResult apply(ExpressionContext context, ExpressionResult input) { ExpressionResult value = valueExpression.apply(context, input); return value.isNonNull() ? new StringExpressionResult(format(context, input, value.getNumericValue())) : NullExpressionResult.INSTANCE ; } FormatDateExpression(String alias, Expression... parameters); @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 apply() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue("value", numericValue(1511442724079L), "format", stringValue("dd-MM-yyyy"))); assertEquals("23-11-2017", actual.getValue()); }
@Test public void applyDay() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue("value", numericValue(1511442724079L), "format", stringValue("F"))); assertEquals("4", actual.getValue()); }
@Test public void applyWeek() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue("value", numericValue(1511442724079L), "format", stringValue("w"))); assertEquals("47", actual.getValue()); }
@Test public void applyMonth() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue("value", numericValue(1511442724079L), "format", stringValue("MM"))); assertEquals("11", actual.getValue()); }
@Test public void applyYear() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue("value", numericValue(1511442724079L), "format", stringValue("yyyy"))); assertEquals("2017", actual.getValue()); }
@Test public void applyHour() { ExpressionResult actual = testSubject.apply(expressionContext, mapValue("value", numericValue(1511442724079L), "format", stringValue("HH"))); assertEquals("13", actual.getValue()); }