@Test
public void isConnectedReturnsTrue() throws ConnectionException, IOException {

  doReturn(false).when(socket).isBound();
  doReturn(false).when(socket).isClosed();
  doReturn(true).when(socket).isConnected();
  doReturn(false).when(socket).isInputShutdown();
  doReturn(false).when(socket).isOutputShutdown();
  assertFalse(connection.isConnected());
}