private static <T> T showMenu(String menuName, List<T> options, Function<T, String> toString) {
		while (true) {
			try {
				int selection;
				System.out.println("*** " + menuName + " ***");
				for (int i = 0; i < options.size(); ++i) {
					System.out.println((i + 1) + ".) " + toString.apply(options.get(i)));
				}
				System.out.println("0.) Quit");
				System.out.println("********************");
				final String selectionString = getStringFromUser("Enter your option");
				selection = Integer.parseInt(selectionString);

				final boolean isSelectionAccepted = selection == 0 || selection <= options.size();
				if (!isSelectionAccepted) {
					System.out.println("Your selection " + selection
							+ " is not a supported option. Please choose one of the following numbers.");
					continue;
				}

				return selection == 0 ? null : options.get(selection - 1);
			} catch (final Exception e) {
				System.err.println("The selection was not a number! Please enter one of the following numbers.");
				continue;
			}
		}
	}