public void checkDFAConstruction(LexerGrammar lg, Grammar g, int decision,
	                                 String[] inputString, String[] dfaString)
	{
//		Tool.internalOption_ShowATNConfigsInDFA = true;
		ATN lexatn = createATN(lg, true);
		LexerATNSimulator lexInterp =
		new LexerATNSimulator(lexatn,new DFA[] { new DFA(lexatn.getDecisionState(Lexer.DEFAULT_MODE)) }, new PredictionContextCache());

		semanticProcess(lg);
		g.importVocab(lg);
		semanticProcess(g);

		ParserInterpreterForTesting interp = new ParserInterpreterForTesting(g, null);
		for (int i=0; i<inputString.length; i++) {
			// Check DFA
			IntegerList types = getTokenTypesViaATN(inputString[i], lexInterp);
//			System.out.println(types);
			TokenStream input = new MockIntTokenStream(types);
			try {
				interp.adaptivePredict(input, decision, ParserRuleContext.EMPTY);
			}
			catch (NoViableAltException nvae) {
				nvae.printStackTrace(System.err);
			}
			DFA dfa = interp.parser.decisionToDFA[decision];
			assertEquals(dfaString[i], dfa.toString(g.getVocabulary()));
		}
	}
first check that the ATN predicts right alt.
 Then check adaptive prediction.
tool-testsuite/test/org/antlr/v4/test/tool/TestATNParserPrediction.java