code: private List<ServletRegistration> getServletRegistration(ServletContext context)
     {
        for (ServletRegistrationProvider provider : getServletRegistrationProviders())
        {
           List<ServletRegistration> registrations = provider.getServletRegistrations(context);
           if (registrations != null)
           {
              return registrations;
           }
        }
        throw new IllegalStateException("Unable to find the Servlet registrations of the application");
     }
docs: Obtains the list of registered {@link Servlet} instances using the {@link ServletRegistrationProvider} SPI.