code: private SortedSet<Date> readDates(JSONValue json) {
  
          JSONArray array = null == json ? null : json.isArray();
          if (null != array) {
              SortedSet<Date> result = new TreeSet<>();
              for (int i = 0; i < array.size(); i++) {
                  Date d = readOptionalDate(array.get(i));
                  if (null != d) {
                      result.add(d);
                  }
              }
              return result;
          }
          return new TreeSet<>();
      }
docs: Extracts the dates from a JSON array.
  @param json the JSON array where the dates are stored in.
  @return list of the extracted dates.