### Question:
DefaultNetworkConnectionTracker implements NetworkConnectionTracker { @Override public void add( TrackedNetworkConnection connection ) { TrackedNetworkConnection previousConnection = connectionsById.put( connection.id(), connection ); if ( previousConnection != null ) { throw new IllegalArgumentException( "Attempt to register a connection with an existing id " + connection.id() + ". " + "Existing connection: " + previousConnection + ", new connection: " + connection ); } }  @Override String newConnectionId( String connector ); @Override void add( TrackedNetworkConnection connection ); @Override void remove( TrackedNetworkConnection connection ); @Override TrackedNetworkConnection get( String id ); @Override List<TrackedNetworkConnection> activeConnections();  }### Answer:
@Test void shouldFailWhenAddingConnectionWithSameId() { tracker.add( connection1 ); assertThrows( IllegalArgumentException.class, () -> tracker.add( connection1 ) ); }