private static ArrayList<Ability> generateAbilities(int numberOfAbilities) {
		ArrayList<Ability> abilities = new ArrayList<Ability>(numberOfAbilities+1);
		abilities.add(Ability.ATTACK);
		ArrayList<Ability> possibleAbilities = new ArrayList<Ability>(Arrays.asList(Ability.values()));
		possibleAbilities.remove(Ability.ATTACK); //Every unit can ATTACK, so don't generate it as a random ability.
		
		for (int i = 0; i < numberOfAbilities;) {
			if (possibleAbilities.isEmpty()) {
				break; //If the unit has all the available abilities, we're done.
			}
			//EXTRA: Arrange the randomized abilities in a specific order (maybe alphabetically.)
			//ALT: Keeping them in a random order means more unit variation.
			int abilityIndex = MathUtil.randomInteger(0, possibleAbilities.size()-1);
			Ability ability = possibleAbilities.get(abilityIndex);
			possibleAbilities.remove(ability);
			if (!abilities.contains(ability)) {
				abilities.add(ability);
				i++;
			}
		}
		
		return abilities;
	}