@Test public void testEofClosure() {
		String grammar =
				"lexer grammar EofClosure;\n" +
				"EofClosure: 'x' EOF*;\n" +
				"EofInAlternative: 'y' ('z' | EOF);";

		String expected =
			"error(" + ErrorType.EOF_CLOSURE.code + "): EofClosure.g4:2:0: rule EofClosure contains a closure with at least one alternative that can match EOF\n";

		String[] pair = new String[] {
				grammar,
				expected
		};

		testErrors(pair, true);
	}
This is a regression test for antlr/antlr4#190
"NullPointerException building lexer grammar using bogus 'token' action"
https://github.com/antlr/antlr4/issues/190
tool-testsuite/test/org/antlr/v4/test/tool/TestToolSyntaxErrors.java