### Question:
JettyHttpConnectionListener implements Connection.Listener { @Override public void onOpened( Connection connection ) { if ( connection instanceof JettyHttpConnection ) { connectionTracker.add( (JettyHttpConnection) connection ); } } JettyHttpConnectionListener( NetworkConnectionTracker connectionTracker ); @Override void onOpened( Connection connection ); @Override void onClosed( Connection connection );  }### Answer:
@Test void shouldNotifyAboutOpenConnection() { JettyHttpConnection connection = mock( JettyHttpConnection.class ); listener.onOpened( connection ); verify( connectionTracker ).add( connection ); verify( connectionTracker, never() ).remove( any() ); }
@Test void shouldIgnoreOpenConnectionOfUnknownType() { Connection connection = mock( Connection.class ); listener.onOpened( connection ); verify( connectionTracker, never() ).add( any() ); verify( connectionTracker, never() ).remove( any() ); }