code: private JSONArray datesToJson(Collection<Date> individualDates) {
  
          if (null != individualDates) {
              JSONArray result = new JSONArray();
              for (Date d : individualDates) {
                  result.put(dateToJson(d));
              }
              return result;
          }
          return null;
      }
docs: Converts a list of dates to a Json array with the long representation of the dates as strings.
  @param individualDates the list to convert.
  @return Json array with long values of dates as string