private void doCompletionInsertionTest(String codeBefore, Runnable callBeforePopup,
			int charsToRemove, Runnable callWhenPopupOpens, String completion,
			String expectedResult) {
		CodeCompletion c = new CodeCompletion("t", completion, null, charsToRemove);
		testingCodeCompletions = List.of(c);
		triggerText(inputTextPane, codeBefore);
		if (callBeforePopup != null) {
			runSwing(() -> callBeforePopup.run());	
		}

		// open the completion popup and insert the first and only suggestion
		KeyStroke defaultCompletionTrigger = CompletionWindowTrigger.TAB.getKeyStroke();
		triggerKey(inputTextPane, defaultCompletionTrigger);
		triggerActionKey(inputTextPane, 0, KeyEvent.VK_DOWN);
		if (callWhenPopupOpens != null) {
			runSwing(() -> callWhenPopupOpens.run());	
		}
		triggerEnter(inputTextPane);

		assertEquals(expectedResult, inputTextPane.getText());
		triggerEnter(inputTextPane);
	}
Test the InterpreterPanel/InterpreterConsole's stdIn InputStream handling by 
manually creating a JFrame (while a regular Ghidra tool is running)
to host the panel in.
Ghidra/Features/Base/src/test.slow/java/ghidra/app/plugin/core/interpreter/InterpreterPanelTest.java