@Override
    public void sort(List<T> list) {
        Map<T, Counter> countMap = new TreeMap<>();
        int size = list.size();
        for ( int i = 0 ; i < size ; i ++ ) {
            T value = list.get(i);
            if ( ! countMap.containsKey(value) ) {
                countMap.put(value, new Counter());
            }
            Counter counter = countMap.get(value);
            counter.value ++;
        }

        int listIndex  = 0;
        for ( Map.Entry<T, Counter> entry : countMap.entrySet() ) {
            T key = entry.getKey();
            for ( int i = entry.getValue().value ; i > 0 ; i -- ) {
                 list.set(listIndex, key);
                 listIndex ++;
             }
        }
    }