@Test(timeout = 20000)
	public void testCodeCompletionInsertion() {
		// test the general ability to insert text with the code completion popup;
		// and also make sure that the completion doesn't accidentally destroy 
		// a part of the input near the caret

		// case 1: "simple." => "simple.completion"
		// @formatter:off
		doCompletionInsertionTest(
				"simple.",             // an initial piece of code 
				null,                  // a function to call before the popup opens
				0,                     // the number of characters to delete
				null,                  // a function to call when the popup is opened
				"completion",          // a completion to insert
				"simple.completion");  // an expected result
		// @formatter:on

		// case 2: "simple." => "not.so.simple.completion"
		doCompletionInsertionTest("simple.", null, "simple.".length(), null, 
				"not.so.simple.completion", "not.so.simple.completion");

		// case 3: "( check.both.sides.of<caret> )" => "( check.is.ok )"
		doCompletionInsertionTest("( check.both.sides.of )",
				() -> inputTextPane.setCaretPosition("( check.both.sides.of".length()),
				"both.sides.of".length(), null, "is.ok", "( check.is.ok )");

		// case 4: Completions are inserted at the place where they were last updated. 
		// Moving the caret after that point should not affect the result.
		var possibleCaretPositions = List.of(0, "some".length(), "some initial text".length());
		for (int caretPos : possibleCaretPositions) {
			doCompletionInsertionTest("some initial text",
					() -> inputTextPane.setCaretPosition("some initial".length()),
					"initial".length(),
					() -> inputTextPane.setCaretPosition(caretPos), "expected",
					"some expected text");
		}
	}
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