#vulnerable code 
                                @Test
    public void roundRobinLoadBalanceTest() {

        List<DivideUpstream> divideUpstreamList =
                Arrays.asList(50, 20, 30).stream()
                        .map(weight -> {
                            DivideUpstream divideUpstream = new DivideUpstream();
                            divideUpstream.setUpstreamUrl("divide-upstream-" + weight);
                            divideUpstream.setWeight(weight);
                            return divideUpstream;
                        })
                        .collect(Collectors.toList());

        RoundRobinLoadBalance roundRobinLoadBalance = new RoundRobinLoadBalance();
        Map<String, Integer> countMap = new HashMap<>();
        for(int i=0; i<100; i++) {
            DivideUpstream result = roundRobinLoadBalance.select(divideUpstreamList, "");
            int count = countMap.getOrDefault(result.getUpstreamUrl(), 0);
            countMap.put(result.getUpstreamUrl(), ++count);
        }

        Assert.assertEquals(50, countMap.get("divide-upstream-50").intValue());
    } 
                            #location 22 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void roundRobinLoadBalanceTest() {

        List<DivideUpstream> divideUpstreamList =
                Stream.of(50, 20, 30)
                        .map(weight -> {
                            DivideUpstream divideUpstream = new DivideUpstream();
                            divideUpstream.setUpstreamUrl("divide-upstream-" + weight);
                            divideUpstream.setWeight(weight);
                            return divideUpstream;
                        })
                        .collect(Collectors.toList());

        RoundRobinLoadBalance roundRobinLoadBalance = new RoundRobinLoadBalance();
        Map<String, Integer> countMap = new HashMap<>();
        for (int i = 0; i < 120; i++) {
            DivideUpstream result = roundRobinLoadBalance.select(divideUpstreamList, "");
            int count = countMap.getOrDefault(result.getUpstreamUrl(), 0);
            countMap.put(result.getUpstreamUrl(), ++count);
        }

        Assert.assertEquals(50, countMap.get("divide-upstream-50").intValue());
    }