### Question:
RestletServiceServlet extends ServerServlet { @Override public String getInitParameter(String name, String defaultValue) { if (RESTLET_APPLICATION_INIT_PARAM.equals(name)) { return application.getName(); } final String value = servlet.getInitParameter(name); if (value == null) { return defaultValue; } return value; } RestletServiceServlet(final HttpServlet servlet, Class<? extends ServiceEndpointApplication> application,
            String name); @Override String getInitParameter(String name, String defaultValue); @Override String getServletName(); @Override String getInitParameter(String name); @SuppressWarnings("unchecked") @Override Enumeration getInitParameterNames(); @Override ServletConfig getServletConfig(); @Override ServletContext getServletContext(); @Override String getServletInfo(); @Override void log(String msg); @Override void log(String message, Throwable t);  }### Answer:
@Test public void shouldGetApplicationInitParameter() { String initParameter = restletServiceServlet.getInitParameter("org.restlet.application", "ANY"); assertEquals(initParameter, TestServiceEndpointApplication.class.getName()); }
@Test public void shouldGetInitParameterWithoutDefault() { given(servlet.getInitParameter("INIT_PARAM_NAME")).willReturn("VALUE"); String initParameter = restletServiceServlet.getInitParameter("INIT_PARAM_NAME", "ANY"); assertEquals(initParameter, "VALUE"); }
@Test public void shouldGetInitParameterWithDefault() { given(servlet.getInitParameter("INIT_PARAM_NAME")).willReturn(null); String initParameter = restletServiceServlet.getInitParameter("INIT_PARAM_NAME", "ANY"); assertEquals(initParameter, "ANY"); }
@Test public void shouldGetInitParameter() { restletServiceServlet.getInitParameter("NAME"); verify(servlet).getInitParameter("NAME"); }