public <T> List<T> parseChoices(String val, List<T> validChoices,
			List<String> stringRepresentationOfValidChoices) {

		Set<String> choiceStringSet = new HashSet<>(getValues(val));
		List<T> ret = new LinkedList<>();
		for (int i = 0; i < stringRepresentationOfValidChoices.size(); i++) {
			if (choiceStringSet.contains(stringRepresentationOfValidChoices.get(i))) {
				ret.add(validChoices.get(i));
			}
		}

		if (!ret.isEmpty()) {
			return ret;
		}

		throw new IllegalArgumentException("Invalid choices: " + val);
	}
Parses choices from a string.

@param val The string to parse.
@param validChoices A list of valid choices.
@param stringRepresentationOfValidChoices An corresponding array of valid choice string
         representations.
@return The choices
@throws IllegalArgumentException if the parsed string did not contain any valid choices.
Ghidra/Features/Base/src/main/java/ghidra/app/script/GhidraScript.java