mockHandlerXml.matchAndReturn("getExtension", "xml");
mockHandlerXml.matchAndReturn("getContentType", "application/xml");
mockHandlerXml.matchAndReturn("toString", "xml");
Mock mockHandlerJson = new Mock(ContentTypeHandler.class);
mockHandlerJson.matchAndReturn("getExtension", "json");
mockHandlerJson.matchAndReturn("getContentType", "application/javascript");
mockHandlerJson.matchAndReturn("toString", "json");
Mock mockHandlerXmlOverride = new Mock(ContentTypeHandler.class);
mockHandlerXmlOverride.matchAndReturn("getExtension", "xml");
mockHandlerXmlOverride.matchAndReturn("toString", "xmlOverride");
mockHandlerXmlOverride.matchAndReturn("getContentType", "application/xml");