CustomExceptionHandler implements Thread.UncaughtExceptionHandler { Map<String, StoredException> getStoredExceptions(){ if(exceptionPersister != null) { return exceptionPersister.loadAll(); } else { return null; } } CustomExceptionHandler(Context context, List<CrashReportingService> crashReportingServices, boolean wifiOnly); @Override void uncaughtException(Thread thread, Throwable ex);  }
@Test public void testGetStoredExceptions() { ExceptionPersister mockExceptionPersister = mock(ExceptionPersister.class); CustomExceptionHandler customExceptionHandler = new CustomExceptionHandler(null, null, false); customExceptionHandler.exceptionPersister = mockExceptionPersister; customExceptionHandler.getStoredExceptions(); verify(mockExceptionPersister).loadAll(); }