@Override
	public String promptWithOptions(String prompt, String defaultValue, String... options) {
		List<String> optionsAsList = Arrays.asList(options);
		InputStreamReader console = new InputStreamReader(System.in);
		String answer;
		do {
			System.out.format("%s %s: ", prompt, optionsAsList);
			answer = read(console, true);
		}
		while (!optionsAsList.contains(answer) && !"".equals(answer));
		return "".equals(answer) && !optionsAsList.contains("") ? defaultValue : answer;
	}
Loops until one of the {@code options} is provided. Pressing return is equivalent to returning
{@code defaultValue}.
spring-xd-shell/src/main/java/org/springframework/xd/shell/command/ConsoleUserInput.java