@Override
    public String getBasePath() {
        ClassLoader prevClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(classLoader);
            return servlet.getBasePath();
        } finally {
            Thread.currentThread().setContextClassLoader(prevClassLoader);
        }
    }
@Test
    public void testWrapper() throws Exception {
        AdditionalServlet servlet = mock(AdditionalServlet.class);
        NarClassLoader loader = mock(NarClassLoader.class);
        AdditionalServletWithClassLoader wrapper = new AdditionalServletWithClassLoader(servlet, loader);

        String basePath = "metrics/pulsar";

        when(servlet.getBasePath()).thenReturn(basePath);
        assertEquals(basePath, wrapper.getBasePath());
        verify(servlet, times(1)).getBasePath();
    }