### Question:
RestServlet extends HttpServlet { @Override public final void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (this instanceof Get) { RestUrl url = parse(req); if (url.isValid()) { ((Get) this).get(req, resp, url); } else { onInvalidUrl(url); super.doGet(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 whenUrlIsValidThenGetIsCalled() throws ServletException, IOException { servlet.doGet(request, response); verify(callback).onMethodCalled(Get); }