### Question:
RestServlet extends HttpServlet { @Override protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (this instanceof Trace) { RestUrl url = parse(req); if (url.isValid()) { ((Trace) this).trace(req, resp, url); } else { onInvalidUrl(url); super.doTrace(req, resp); } } } protected  RestServlet(String pattern, VarType... types); @Override final void doGet(HttpServletRequest req, HttpServletResponse resp); @Override final void doPost(HttpServletRequest req, HttpServletResponse resp); @Override final void doPut(HttpServletRequest req, HttpServletResponse resp); @Override final void doDelete(HttpServletRequest req, HttpServletResponse resp);  }### Answer:
@Test public void whenUrlIsValidThenTraceIsCalled() throws ServletException, IOException { servlet.doTrace(request, response); verify(callback).onMethodCalled(Trace); }