ShutdownHelper { public static void shutdown(int status) { Process.killProcess(Process.myPid()); System.exit(status); } @VisibleForTesting  ShutdownHelper(); static void shutdown(int status);  }
@Test public void shutdown() { new ShutdownHelper(); when(Process.myPid()).thenReturn(123); ShutdownHelper.shutdown(999); verifyStatic(); Process.killProcess(123); verifyStatic(); System.exit(999); }