ModernJavaRuntime extends AbstractJavaRuntime { @Override public TimestampFormatter createTimestampFormatter(final String pattern, final Locale locale) { return new PreciseTimestampFormatter(pattern, locale); } ModernJavaRuntime(); @Override boolean isAndroid(); @Override long getProcessId(); @Override Timestamp getStartTime(); @Override String getCallerClassName(final int depth); @Override String getCallerClassName(final String loggerClassName); @Override StackTraceElement getCallerStackTraceElement(final int depth); @Override StackTraceElement getCallerStackTraceElement(final String loggerClassName); @Override Timestamp createTimestamp(); @Override TimestampFormatter createTimestampFormatter(final String pattern, final Locale locale);  }
@Test public void createTimestampFormatter() { ModernJavaRuntime runtime = new ModernJavaRuntime(); TimestampFormatter formatter = runtime.createTimestampFormatter("yyyy-MM-dd HH:mm:ss.SSS", Locale.US); assertThat(formatter).isInstanceOf(PreciseTimestampFormatter.class); Timestamp timestamp = TimestampFactory.create(1985, 6, 3, 12, 30, 55, 999_001_002); assertThat(formatter.format(timestamp)).isEqualTo("1985-06-03 12:30:55.999"); }