@Test public void test2Mark() throws Exception {
		TestingUnbufferedCharStream input = createStream("xyz", 100);
   		assertEquals('x', input.LA(1));
        input.consume(); // reset buffer index (p) to 0
        int m1 = input.mark();
   		assertEquals('y', input.LA(1));
        input.consume();
        int m2 = input.mark();
		assertEquals("yz", input.getBuffer());
        input.release(m2); // drop to 1 marker
        input.consume();
        input.release(m1); // shifts remaining char to beginning
   		assertEquals(IntStream.EOF, input.LA(1));
		assertEquals("\uFFFF", input.getBuffer());
   	}
It is not valid to pass a mark to {@link IntStream#seek}, but
{@link UnbufferedCharStream} creates marks in such a way that this
invalid usage results in an {@link IllegalArgumentException}.
tool-testsuite/test/org/antlr/v4/test/tool/TestUnbufferedCharStream.java