public static int[] generateRandomIntArray(int size, boolean allowsDuplicate, int min, int max)throws ArrayIndexOutOfBoundsException {
		if(countNumbersInRange(min, max) < size) {
			throw new ArrayIndexOutOfBoundsException();
		}
		int randArr[] = new int[size];
		int randNum = MathUtils.generateRandomNumb(min, max);
		for(int i = 0; i < size; i++) {
			if(SearchAndSort.linearIntSearch(randArr, randNum) && !allowsDuplicate) {
				while(true) {
					randNum = MathUtils.generateRandomNumb(min, max);
					if(!SearchAndSort.linearIntSearch(randArr, randNum)) {
						randArr[i] = randNum;
						break;
					}
				}
			}
			randArr[i] = randNum;
			randNum = MathUtils.generateRandomNumb(min, max);
		}

		return randArr;
	}