@Test
	public void testLastChar() {
		CharStream input = createStream("abcdef");

		input.consume();
		assertEquals('a', input.LA(-1));

		int m1 = input.mark();
		input.consume();
		input.consume();
		input.consume();
		assertEquals('d', input.LA(-1));

		input.seek(2);
		assertEquals('b', input.LA(-1));

		input.release(m1);
		input.seek(3);
		assertEquals('c', input.LA(-1));
		// this special case is not required by the IntStream interface, but
		// UnbufferedCharStream allows it so we have to make sure the resulting
		// state is consistent
		input.seek(2);
		assertEquals('b', input.LA(-1));
	}
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