In the earlier ApplicationConfig class, you will also notice a call to the ResourceConfig::packages(String... packages) method with an array of packages as the parameter. This tells the runtime to scan the input packages for discovering the JAX-RS components (which include REST resources and provider components) used in the application. You can also use the ResourceConfig::register() method to register an individual JAX-RS component as appropriate.
To learn more about the APIs exposed in the ResourceConfig class, visit the API documentation at https://jersey.github.io/apidocs/latest/jersey/index.html.