### Question:
CajaContentRewriter implements GadgetRewriter { public CajoledResult rewrite(Uri uri, String container, String mime, boolean es53, boolean debug) { URI javaUri = uri.toJavaUri(); InputSource is = new InputSource(javaUri); MessageQueue mq = new SimpleMessageQueue(); try { UriFetcher fetcher = makeFetcher(uri, container); ExternalReference extRef = new ExternalReference(javaUri, FilePosition.instance(is, 1, 1, 1)); CharProducer cp = fetcher.fetch(extRef, mime).getTextualContent(); ParseTreeNode ptn = parse(is, cp, mime, mq); return rewrite(uri, container, ptn, es53, debug); } catch (UnsupportedEncodingException e) { LOG.severe("Unexpected inability to recognize mime type: " + mime); mq.addMessage(ServiceMessageType.UNEXPECTED_INPUT_MIME_TYPE, MessagePart.Factory.valueOf(mime)); } catch (UriFetchException e) { LOG.info("Failed to retrieve: " + e.toString()); } catch (ParseException e) { mq.addMessage(MessageType.PARSE_ERROR, FilePosition.UNKNOWN); } return new CajoledResult(null, null, mq.getMessages(), true); } @Inject  CajaContentRewriter(CacheProvider cacheProvider, RequestPipeline requestPipeline,
                             HtmlSerializer htmlSerializer, ProxyUriManager proxyUriManager); CajoledResult rewrite(Uri uri, String container, String mime,
      boolean es53, boolean debug); CajoledResult rewrite(Uri gadgetUri, String container,
      ParseTreeNode root, boolean es53, boolean debug); void rewrite(Gadget gadget, MutableContent mc); static final String CAJOLED_MODULES; }### Answer:
@Test public void testRewrite() throws Exception { String markup = "<script>window['a']=0;</script>"; String expected = "caja___.start"; List<String> messages = ImmutableList.of(); testMarkup(markup, expected, messages); }