AndroidRuntime implements RuntimeDialect { @Override public long getProcessId() { return Process.myPid(); } 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 @PrepareForTest(Process.class) public void processId() { mockStatic(Process.class); when(Process.myPid()).thenReturn(123); assertThat(new AndroidRuntime().getProcessId()).isEqualTo(123); }