DefaultErrorHandler implements ErrorHandler { @Override public void handleError(final Exception exception, final String message) { Log.e(LOG_TAG, message, exception); }  @Override void handleError(final Exception exception, final String message);  }
@Test public void shouldHandleErrorDuringClosingSocket() { final String errorMsg = "Could not close the socket"; final Exception exception = new Exception(errorMsg); handler.handleError(exception, errorMsg); verify(handler, times(1)).handleError(exception, errorMsg); }