@Override
    protected Upstream doSelect(final List<Upstream> upstreamList, final String ip) {
        long start = System.currentTimeMillis();
        Upstream[] upstreams = pickTwoUpstreams(upstreamList);
        Upstream picked;
        Upstream unpicked;
        if (load(upstreams[0]) > load(upstreams[1])) {
            picked = upstreams[1];
            unpicked = upstreams[0];
        } else {
            picked = upstreams[0];
            unpicked = upstreams[1];
        }
        // If the failed node is not selected once in the forceGap period, it is forced to be selected once.
        long pick = unpicked.getLastPicked();
        if ((start - pick) > FORCE_GAP) {
            unpicked.setLastPicked(start);
            picked = unpicked;
        }

        if (picked != unpicked) {
            picked.setLastPicked(start);
        }
        picked.getInflight().incrementAndGet();
        return picked;
    }
@Test
    public void testResponseTimeBalancerSameInflight() {
        buildUpstreamList();
        final P2cLoadBalancer p2cLoadBalancer = new P2cLoadBalancer();
        upstreamList.get(0).setLag(1);
        Upstream upstream = p2cLoadBalancer.doSelect(upstreamList, "localhost");
        Upstream upstream1 = p2cLoadBalancer.doSelect(upstreamList, "localhost");
        Assertions.assertTrue(upstream.getUrl().equals("baidu.com") && upstream1.getUrl().equals("pro.jd.com"));
    }