### Question:
ExpressionHelper implements FunctionMapper, VariableResolver { public static String formatTime(String dateTimeStr, String format) throws ParseException { Date dateTime = DateUtil.parseDateFalconTZ(dateTimeStr); return DateUtil.formatDateCustom(dateTime, format); } private  ExpressionHelper(); static ExpressionHelper get(); T evaluate(String expression, Class<T> clazz); @SuppressWarnings("unchecked") T evaluateFullExpression(String expression, Class<T> clazz); @Override Method resolveFunction(String prefix, String name); void setPropertiesForVariable(Properties properties); @Override Object resolveVariable(String field); static void setReferenceDate(Date date); static Properties getTimeVariables(Date date, TimeZone tz); static Date now(int hour, int minute); static Date today(int hour, int minute); static Date yesterday(int hour, int minute); static Date currentMonth(int day, int hour, int minute); static Date lastMonth(int day, int hour, int minute); static Date currentWeek(String weekDay, int hour, int minute); static Date lastWeek(String weekDay, int hour, int minute); static Date currentYear(int month, int day, int hour, int minute); static Date lastYear(int month, int day, int hour, int minute); static Date latest(int n); static Date future(int n, int limit); static long hours(int val); static long minutes(int val); static long days(int val); static long months(int val); static long years(int val); static String substitute(String originalValue); static String substitute(String originalValue, Properties properties); static String formatTime(String dateTimeStr, String format); static String instanceTime(); static String dateOffset(String strBaseDate, int offset, String unit); static String user(); static final ThreadLocal<SimpleDateFormat> FORMATTER; }### Answer:
@Test public void testFormatTime() throws FalconException { String output = expressionHelper.evaluate("formatTime(\"2016-02-01T10:59Z\", \"yyyy\")", String.class); Assert.assertEquals(output, "2016"); output = expressionHelper.evaluate("formatTime(\"2016-02-01T10:59Z\", \"yyyy-MM\")", String.class); Assert.assertEquals(output, "2016-02"); output = expressionHelper.evaluate("formatTime(\"2016-02-01T10:59Z\", \"yyyy-MM-dd\")", String.class); Assert.assertEquals(output, "2016-02-01"); }