code: public Photocounts getCounts(List<Date> dates, List<Date> takenDates) throws JinxException {
      Map<String, String> params = new TreeMap<>();
      params.put("method", "flickr.photos.getCounts");
      if (!JinxUtils.isNullOrEmpty(dates)) {
        Collections.sort(dates);
        List<String> formattedDates = new ArrayList<String>();
        for (Date date : dates) {
          formattedDates.add(JinxUtils.formatDateAsUnixTimestamp(date));
        }
        params.put("dates", JinxUtils.buildCommaDelimitedList(formattedDates));
      }
      if (!JinxUtils.isNullOrEmpty(takenDates)) {
        List<String> formattedDates = new ArrayList<String>();
        for (Date date : takenDates) {
          formattedDates.add(JinxUtils.formatDateAsMySqlTimestamp(date));
        }
        params.put("taken_dates", JinxUtils.buildCommaDelimitedList(formattedDates));
      }
      return jinx.flickrGet(params, Photocounts.class);
    }
docs: Gets a list of photo counts for the given date ranges for the calling user.
  <br>
  This method requires authentication with 'read' permission.
  <br>
  You must provide either dates or takenDates parameters. Flickr may not return correct results if you specify both.
  
  @param dates      a list of dates denoting the periods to return counts for. They should be specified smallest first.
  @param takenDates a list of dates denoting the periods to return counts for. They should be specified smallest first.
  @return object containing a list of counts for the specified dates.
  @throws JinxException if there are any errors.
  @see <a href="https://www.flickr.com/services/api/flickr.photos.getCounts.html">flickr.photos.getCounts</a>