CustomExceptionHandler implements Thread.UncaughtExceptionHandler { boolean isRunning(){ return Thread.getDefaultUncaughtExceptionHandler() == this; } CustomExceptionHandler(Context context, List<CrashReportingService> crashReportingServices, boolean wifiOnly); @Override void uncaughtException(Thread thread, Throwable ex);  }
@Test public void testIsRunning(){ CustomExceptionHandler customExceptionHandler = new CustomExceptionHandler(null, null, false); assertFalse(customExceptionHandler.isRunning()); customExceptionHandler.start(); assertTrue(customExceptionHandler.isRunning()); customExceptionHandler.stop(); assertFalse(customExceptionHandler.isRunning()); }