code: protected Calendar toCalender(String date, String datePattern) {
          SimpleDateFormat dateFormat = new SimpleDateFormat(datePattern);
          Calendar cal = Calendar.getInstance();
          try {
              cal.setTime(dateFormat.parse(date));
          } catch (ParseException e) {
              throw new CitrusRuntimeException(String.format("Error parsing date '%s' using pattern '%s'", date, datePattern), e);
          }
          return cal;
      }
docs: Converts the supplied date to it's calendar representation. The {@code datePattern} is
  used for parsing the date.
  
  @param date        the date to parse
  @param datePattern the date format to use when parsing the date
  @return the calendar representation