@Test
public void shouldLogError_whenProblemClosingSocket() throws IOException {

  SocketInternetObservingStrategy sut = spy(detailedStrategyBuilder().build());
  Socket socket = mock(Socket.class);
  doThrow(IOException.class).when(socket).close();
  doReturn(socket).when(sut).connectSocketTo(any(SocketAddress.class), anyInt());
  sut.observe().blockingFirst();
  verify(sut).onError(anyString(), any(Exception.class));
}