Summary
-------
Introduce a new method that returns the main method to invoke per JLS of the given presumably initial class or interface.
Problem
-------
With the introduction of JEP 512, Compact Source Files and Instance Main Methods, the determination of an initial class or interface's main method to be invoked is no longer a simple algorithm. There are now many candidate methods.
Solution
--------
Introduce a new method, `getMainClass`, in `java.lang.Class` that returns the `main` method to invoke. This is helpful for when a class has many candidate methods.
This new method does not involve determining if a class or interface is the initial class or interface, initialization of that class or interface, or how the `main` method should be invoked, such as pushing arguments or initializing an object instance.
Specification
-------------
```
/**
* Return the {@code main} method to be invoked per JLS {@jls 12.1.4} when
* this {@code Class} object represents the initial class or interface, or
* {@code null} if no candidate method exists.
* <p>
* A candidate method:
* <ul>
* <li>has a single formal parameter of type {@code String[]}, or has no
* formal parameter</li>
* <li>has a return type of {@code void}</li>
* <li>is public, protected or package private</li>
* </ul>
* Multiple candidate methods may be present in a class or interface. In
* that case, this method returns the one selected per JLS.
*
* @apiNote
* It is the caller's responsibility to determine whether this {@code Class}
* object represents the initial class or interface, initialize this class
* or interface before invocation, and find out how to invoke the returned
* {@code main} method.
*
* @return the main method to be invoked, may be {@code null}
*
* @jls 8.2 Class Members
* @jls 8.4 Method Declarations
* @jls 8.4.2 Method Signature
* @jls 12.1.4 Invoke a {@code main} method
* @since 25
*/
```