@Test public void test2ReplaceMiddleIndex1InsertBefore() throws Exception {
		LexerGrammar g = new LexerGrammar(
											 "lexer grammar T;\n"+
											 "A : 'a';\n" +
											 "B : 'b';\n" +
											 "C : 'c';\n");
		String input = "abc";
		LexerInterpreter lexEngine = g.createLexerInterpreter(new ANTLRInputStream(input));
		CommonTokenStream stream = new CommonTokenStream(lexEngine);
		stream.fill();
		TokenStreamRewriter tokens = new TokenStreamRewriter(stream);
		tokens.insertBefore(0, "_");
		tokens.replace(1, "x");
		tokens.replace(1, "y");
		String result = tokens.getText();
		String expecting = "_ayc";
		assertEquals(expecting, result);
	}
Public default constructor used by TestRig
runtime-testsuite/test/org/antlr/v4/test/runtime/java/api/TestTokenStreamRewriter.java