LuceneUtils { public static String getLuceneDateString(Date date) { return LUCENE_DATETIME_FORMAT.format(date); }  static boolean fieldHasTerm(IndexReader indexReader, String field); static String getLuceneDateString(Date date); static String createDateRangeQuery(Date fromDate, Date toDate, QName dateProperty, 
          DictionaryService dictionaryService, NamespaceService namespaceService);  }
@Test public void convertSimpleDate() throws Exception { Calendar cal = Calendar.getInstance(); final int year = 1955; final int month = 10; final int day = 12; final int hours = 22; final int minutes = 04; final int seconds = 00; cal.set(year, month, day, hours, minutes, seconds); Date testDate = cal.getTime(); String dateString = LuceneUtils.getLuceneDateString(testDate); final String expectedString = "1955\\-11\\-12T22:04:00"; assertEquals("Incorrect data string.", expectedString, dateString); }