DateFormatter { public static String print(final DateTime dateTime) { return DATE_TIME_FORMATTER.print(dateTime); } private  DateFormatter(); static String print(final DateTime dateTime); static String print(final Date date); static String print(final LocalDate localDate); static String print(final LocalTime localTime);  }
@Test public void printDateTime_should_beCorrectString() { final DateTime dateTime = new DateTime(2012, 11, 4, 7, 8, 9, 10); assertThat(DateFormatter.print(dateTime), is("2012-11-04 07:08:09.010")); }
@Test public void printDate_should_beCorrectString() { final DateTime dateTime = new DateTime(2012, 11, 4, 7, 8, 9, 10); final Date date = dateTime.toDate(); assertThat(DateFormatter.print(date), is("2012-11-04 07:08:09.010")); }
@Test public void printLocalDate_should_beCorrectString() { final LocalDate localDate = new LocalDate(2012, 11, 4); assertThat(DateFormatter.print(localDate), is("2012-11-04")); }
@Test public void printLocalTime_should_beCorrectString() { final LocalTime localTime = new LocalTime(7, 8, 9, 10); assertThat(DateFormatter.print(localTime), is("07:08:09")); }