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