### Question:
VelocityPageContext extends PageContext { @Override public void forward(String relativeUrlPath) throws ServletException, IOException { RequestDispatcher dispatcher = request.getRequestDispatcher(relativeUrlPath); if (dispatcher == null) { throw new IllegalArgumentException("Cannot forward to '" +relativeUrlPath + "'"); } dispatcher.forward(request, new ExternalWriterHttpServletResponse(response, new PrintWriter(velocityWriter))); } VelocityPageContext(Context velocityContext, Writer velocityWriter, ViewContext viewContext); @Override void initialize(Servlet servlet, ServletRequest request,
            ServletResponse response, String errorPageURL,
            boolean needsSession, int bufferSize, boolean autoFlush); @Override void release(); @Override HttpSession getSession(); @Override Object getPage(); @Override ServletRequest getRequest(); @Override ServletResponse getResponse(); @Override Exception getException(); @Override ServletConfig getServletConfig(); @Override ServletContext getServletContext(); @Override void forward(String relativeUrlPath); @Override void include(String relativeUrlPath); @Override void include(String relativeUrlPath, boolean flush); @Override void handlePageException(Exception e); @Override void handlePageException(Throwable t); @Override void setAttribute(String name, Object value); @Override void setAttribute(String name, Object value, int scope); @Override Object getAttribute(String name); @Override Object getAttribute(String name, int scope); @Override Object findAttribute(String name); @Override void removeAttribute(String name); @Override void removeAttribute(String name, int scope); @Override int getAttributesScope(String name); @SuppressWarnings("unchecked") @Override Enumeration<String> getAttributeNamesInScope(int scope); @Override JspWriter getOut(); @SuppressWarnings("deprecation") @Override javax.servlet.jsp.el.ExpressionEvaluator getExpressionEvaluator(); @SuppressWarnings("deprecation") @Override javax.servlet.jsp.el.VariableResolver getVariableResolver(); @Override ELContext getELContext();  }### Answer:
@Test public void testForwardString() throws ServletException, IOException { RequestDispatcher dispatcher = createMock(RequestDispatcher.class); expect(request.getRequestDispatcher("/my/path")).andReturn(dispatcher); dispatcher.forward(eq(request), isA(ExternalWriterHttpServletResponse.class)); replay(velocityWriter, request, response, servletContext, dispatcher); pageContext.forward("/my/path"); verify(velocityContext, velocityWriter, request, response, servletContext, viewContext, dispatcher); }