class AbstractMapWeightRandomLoadBalance<T> implements WeightRandomLoadBalance<T> {
    @Override
    public Server choose(List<Server> serverList, T t) {<FILL_FUNCTION_BODY>}
}

        if (CollectionUtils.isEmpty(serverList)) {
            return null;
        }

        List<Pair<Server, Integer>> weightList = new ArrayList<Pair<Server, Integer>>();
        for (Server server : serverList) {
            int weight = getWeight(server, t);
            weightList.add(new ImmutablePair<Server, Integer>(server, weight));
        }

        MapWeightRandom<Server, Integer> weightRandom = new MapWeightRandom<Server, Integer>(weightList);

        return weightRandom.random();
    
<no_super_class>