DateFunctions { private static String addDays(int days, @Nullable String format) { Calendar now = Calendar.getInstance(); now.add(Calendar.DAY_OF_YEAR, days); DateFormat formatter = getFormatter(format); return formatter.format(now.getTime()); }  static boolean isValid(String[] values); static String executeFunction(String[] values);  }
@Test public void testAddDays() { String command = "#function.date.addDays.1.MM-dd-yyyy"; String date = FunctionHandler.executeFunction(command, variables); assertNotNull(date); command = "#function.date.addDays.50.MM-dd-yyyy"; date = FunctionHandler.executeFunction(command, variables); assertNotNull(date); command = "#function.date.addDays.-50.MM-dd-yyyy"; date = FunctionHandler.executeFunction(command, variables); assertNotNull(date); }