ModernJavaRuntime extends AbstractJavaRuntime { @Override public long getProcessId() { return currentProcess.pid(); } 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 processId() { assertThat(new ModernJavaRuntime().getProcessId()).isEqualTo(ProcessHandle.current().pid()); }