SolrUtils { public static String serializeDate(Date date) { if (date == null) return null; return newSolrDateFormat().format(date); } private  SolrUtils(); static String clean(String q); static String serializeDate(Date date); static Date parseDate(String date); static String serializeDateRange(Option<Date> startDate, Option<Date> endDate); static DateFormat newSolrDateFormat();  }
@Test public void testSerializeDate() { Date date = newDate(2011, 5, 12, 5, 13, 0); String serializedDate = dateFormatUTC().format(date); assertEquals(serializedDate, SolrUtils.serializeDate(date)); }