@Test
public void testDateCollection() throws Exception {

  @Api
  class DateParameters {
    @SuppressWarnings("unused")
    public void foo(@Named("date") Date date, @Named("dates1") Collection<Date> dates1,
        @Named("dates2") Date[] dates2) { }
  }
  String apiConfigSource = g.generateConfig(DateParameters.class).get("myapi-v1.api");
  ObjectNode root = objectMapper.readValue(apiConfigSource, ObjectNode.class);
  JsonNode request = root.path("methods").path("myapi.dateParameters.foo").path("request");
  verifyMethodRequestParameter(request, "date", "datetime", true, false);
  verifyMethodRequestParameter(request, "dates1", "datetime", true, true);
  verifyMethodRequestParameter(request, "dates2", "datetime", true, true);
  verifyEmptyMethodRequest(root, DateParameters.class.getName() + ".foo");
}