public static Integer[] knuthShuffleWithDuplicatesInt(int seed) {

        Integer[] array = new Integer[seed];
        int rand;
        int temp;
        /**
         * Initialize the array and put it in sorted order first.
         */
        for (int i = 0; i < seed; i += 2) {
            array[i] = i;
            array[i + 1] = i;
        }
        /**
         * Pass the array once and based on the current index "i", pick a random
         * number "rand" between [0 - i] and swap the "ith" and the "randth"
         * elements.
         */
        for (int i = 1; i < seed; i++) {
            rand = (int) (Math.random() * (i));
            temp = array[i];
            array[i] = array[rand];
            array[rand] = temp;
        }
        return array;
    }