class 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 );
        }
    }

}