public ServletRegistration.Dynamic addServlet(String name, Servlet servlet) {
        final ServletHolder holder = new ServletHolder(name, servlet);
        final ServletHandler servletHandler = handler.getServletHandler();
        servletHandler.addServlet(holder);

        final ServletRegistration.Dynamic registration = holder.getRegistration();
        checkDuplicateRegistration(name, servlets, "servlet");

        return registration;
    }
@Test
    void addsServletClasses() throws Exception {
        final Class<ConcatServlet> servletClass = ConcatServlet.class;
        final ServletRegistration.Dynamic builder = environment.addServlet("servlet", servletClass);
        assertThat(builder).isNotNull();

        try {
            servletHandler.start();

            final ServletHolder servletHolder = servletHandler.getServlet("servlet");
            assertThat(servletHolder.getServlet()).isExactlyInstanceOf(servletClass);
        } finally {
            servletHandler.stop();
        }
    }