private <T> T ask_ComboInput(String optionalValue, Callable<T> c) {

		AtomicReference<T> ref = new AtomicReference<>();
		runSwing(() -> {
			try {
				T t = c.call();
				ref.set(t);
			}
			catch (Exception e) {
				failWithException("Exception was caught in this test: " + e.getMessage(), e);
			}
		}, false);

		DialogComponentProvider askDialog = waitForDialogComponent(DialogComponentProvider.class);
		assertNotNull(askDialog);

		if (optionalValue != null) {
			@SuppressWarnings("unchecked")
			JComboBox<String> comboField =
				(JComboBox<String>) findComponentByName(askDialog, "JComboBox");
			setComboBoxSelection(comboField, optionalValue);

			waitForSwing();
		}

		pressButtonByText(askDialog, "OK");
		waitForSwing();

		return ref.get();
	}
A large timeout period that is usually not reached
Ghidra/Features/Base/src/test.slow/java/ghidra/app/script/GhidraScriptAskMethodsTest.java