}
private void addServletWithExistingRegistration(ServletContext sc, ServletRegistration sr,
Class<? extends Application> a, Set<Class<?>> classes) {
if (sr.getClassName() == null) {
final ServletContainer s = new ServletContainer(
new DeferredResourceConfig(a, getRootResourceAndProviderClasses(classes)));
sr = sc.addServlet(a.getName(), s);
if (sr.getMappings().isEmpty()) {
final ApplicationPath ap = a.getAnnotation(ApplicationPath.class);
if (ap != null) {