synchronized JRTConnection switchConnection() {
        if (getSources().size() <= 1) throw new IllegalStateException("Cannot switch connection, not enough sources");

        List<JRTConnection> sourceCandidates = getSources();
        sourceCandidates.remove(currentConnection);
        JRTConnection newConnection = pickNewConnectionRandomly(sourceCandidates);
        log.log(Level.INFO, () -> poolName + ": Switching from " + currentConnection + " to " + newConnection);
        return currentConnection = newConnection;
    }
Preconditions:
1. the current connection is unhealthy and should not be selected when switching
2. There is more than 1 source.
config/src/main/java/com/yahoo/vespa/config/JRTConnectionPool.java