private static int getBestInt(int n) {
        Random rand = new Random();
        Map<Integer, Integer> map = new TreeMap<Integer, Integer>();

        for(int i = 0; i < n; ++i) {
            int r = rand.nextInt(RIGHT_MERGE);
            Integer freq = map.get(r);
            map.put(r, freq == null ? 1 : freq + 1);
        }

        int max = Collections.max(map.values());

        Set<Map.Entry<Integer, Integer>> me =
               new LinkedHashSet<Map.Entry<Integer, Integer>>(map.entrySet());

        int maxKey = 0;
        Iterator<Map.Entry<Integer, Integer>> it = me.iterator();
        while(it.hasNext()) {
            Map.Entry<Integer, Integer> findMax = it.next();
            if(findMax.getValue() == max) {
                maxKey = findMax.getKey();
            }
        }
        return maxKey;
    }