### Question:
RewriteEngine { public String processInbound(final HttpServletRequest request, final HttpServletResponse response, final RewriteRule rule, final String url) { String result = url; if ((rule != null) && rule.isInbound() && rule.matches(url)) { for (Processor p : processors) { result = p.processInbound(request, response, rule, result); } } return result; }  String processInbound(final HttpServletRequest request, final HttpServletResponse response,
            final RewriteRule rule, final String url); String processOutbound(final HttpServletRequest request, final HttpServletResponse response,
            final RewriteRule rule, final String url);  }### Answer:
@Test public void testRegex() throws Exception { RewriteRule c = new RewriteRule(); c.setMatch("foo"); c.setSubstitute("bar"); assertEquals("/my/bar/is/COOL", rewriteEngine.processInbound(null, null, c, url)); }
@Test public void testTrailingSlash() throws Exception { RewriteRule c = new RewriteRule(); c.setTrailingSlash(TrailingSlash.APPEND); assertEquals("/my/foo/is/COOL/", rewriteEngine.processInbound(null, null, c, url)); }
@Test public void testRemoveSingleTrailingSlash() throws Exception { RewriteRule c = new RewriteRule(); c.setTrailingSlash(TrailingSlash.APPEND); assertEquals("/", rewriteEngine.processInbound(null, null, c, "/")); }
@Test public void testToLowerCase() throws Exception { RewriteRule c = new RewriteRule(); c.setToCase(Case.LOWERCASE); assertEquals("/my/foo/is/cool", rewriteEngine.processInbound(null, null, c, url)); }
@Test public void testCustomClassProcessor() throws Exception { RewriteRule c = new RewriteRule(); c.setProcessor(MockCustomClassProcessor.class.getName()); assertEquals(MockCustomClassProcessor.RESULT, rewriteEngine.processInbound(null, null, c, url)); }