The eviction logic is one of the most important parts in our code base: a bug in the eviction logic could allow for attacker triggered network partitioning.

Unfortunately the eviction logic is currently not tested properly.

The unit tests and fuzz tests don't cover the eviction logic at all.

The functional tests cover some parts of the eviction logic but the coverage is spotty/incomplete.

Unfortunately `CConnman::AttemptToEvictConnection` is currently somewhat tricky to test.

To solve this I suggest simplifying `CConnman::AttemptToEvictConnection()` by introducing a new function ...

```
[[nodiscard]] Optional<NodeEvictionCandidate> SelectNodeToEvict(std::vector<NodeEvictionCandidate> vEvictionCandidates)
```

... which would be called from the now much simplified `CConnman::AttemptToEvictConnection`.

`SelectNodeToEvict` would contain all eviction selection logic and could thus be tested trivially.


;
    std::vector<CAddress> GetAddresses(size_t max_addresses, size_t max_pct);
    /**
     * Cache is used to minimize topology leaks, so it should
     * be used for all non-trusted calls, for example, p2p.
     * A non-malicious call (from RPC or a peer with addr permission) should
     * call the function without a parameter to avoid using the cache.
     */
    std::vector<CAddress> GetAddresses(CNode& requestor, size_t max_addresses, size_t max_pct);
    // 
    // 
    void SetTryNewOutboundPeer(bool flag);
    bool GetTryNewOutboundPeer();
    void StartExtraBlockRelayPeers() {
        LogPrint(BCLog::NET, "net: enabling extra block-relay-only peers\n");
        m_start_extra_block_relay_peers = true;
    }
    // 
    // 
    // 
    // 
    // 
    // 
    int GetExtraFullOutboundCount();
    // 
    int GetExtraBlockRelayCount();
    bool AddNode(const std::string& node);
    bool RemoveAddedNode(const std::string& node);
    std::vector<AddedNodeInfo> GetAddedNodeInfo();
    size_t GetNodeCount(NumConnections num);
    void GetNodeStats(std::vector<CNodeStats>& vstats);
    bool DisconnectNode(const std::string& node);
    bool DisconnectNode(const CSubNet& subnet);
    bool DisconnectNode(const CNetAddr& addr);
    bool DisconnectNode(NodeId id);
    //
    //
    //
    //
    //
    //
    ServiceFlags GetLocalServices() const;
    uint64_t GetMaxOutboundTarget();
    std::chrono::seconds GetMaxOutboundTimeframe();
    //
    //
    //
    bool OutboundTargetReached(bool historicalBlockServingLimit);
    //
    //
    uint64_t GetOutboundTargetBytesLeft();
    //
    //
    std::chrono::seconds GetMaxOutboundTimeLeftInCycle();
    uint64_t GetTotalBytesRecv();
    uint64_t GetTotalBytesSent();
    void SetBestHeight(int height);
    int GetBestHeight() const;
    /*
    CSipHasher GetDeterministicRandomizer(uint64_t id) const;
    unsigned int GetReceiveFloodSize() const;
    void WakeMessageHandler();
    /** Attempts to obfuscate tx time through ex