@Test public void shouldHandleErrorDuringClosingSocket() {

  // given
  final String errorMsg = "Could not close the socket";
  final Exception exception = new Exception(errorMsg);
  // when
  handler.handleError(exception, errorMsg);
  // then
  verify(handler, times(1)).handleError(exception, errorMsg);
}