The source for the grammar is the Java Language Specification, version 9. Please note that this grammar is unoptimized: the runtimes for parses will be significantly slower than the optimized Java grammar.
Several of these examples come from the OpenJDK and Android runtime source code.
March 24, 2021