AndroidRuntime implements RuntimeDialect { @Override public Timestamp createTimestamp() { return new LegacyTimestamp(); } AndroidRuntime(); @Override boolean isAndroid(); @Override String getDefaultWriter(); @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 createTimestamp() throws InterruptedException { AndroidRuntime runtime = new AndroidRuntime(); Timestamp timestamp = runtime.createTimestamp(); assertThat(timestamp).isInstanceOf(LegacyTimestamp.class); assertThat(timestamp.toInstant()).isBetween(Instant.now().minusSeconds(1), Instant.now()); Thread.sleep(2); assertThat(runtime.createTimestamp().toInstant()).isAfter(timestamp.toInstant()); }