### Question:
DefaultJsCompiler implements JsCompiler { public Iterable<JsContent> getJsContent(JsUri jsUri, FeatureBundle bundle) { List<JsContent> jsContent = Lists.newLinkedList(); for (FeatureResource resource : bundle.getResources()) { String content = getFeatureContent(jsUri, resource); content = (content != null) ? content : ""; if (resource.isExternal()) { jsContent.add(JsContent.fromFeature("document.write('<script src=\"" + content + "\"></script>')", "[external:" + content + ']', bundle, resource)); } else { jsContent.add(JsContent.fromFeature(content, resource.getName(), bundle, resource)); } jsContent.add(JsContent.fromFeature(";\n", "[separator]", bundle, resource)); } return jsContent; }  Iterable<JsContent> getJsContent(JsUri jsUri, FeatureBundle bundle); JsResponse compile(JsUri jsUri, Iterable<JsContent> content, String externs);  }### Answer:
@Test public void testGetJsContentWithDeb() throws Exception { JsUri jsUri = mockJsUri(true); FeatureResource extRes = mockResource(true, RESOURCE_URL_DEB, RESOURCE_URL_OPT); FeatureResource intRes = mockResource(false, RESOURCE_CONTENT_DEB, RESOURCE_CONTENT_OPT); FeatureBundle bundle = mockBundle(Lists.newArrayList(extRes, intRes)); Iterable<JsContent> actual = compiler.getJsContent(jsUri, bundle); assertEquals( "document.write('<script src=\"" + RESOURCE_URL_DEB + "\"></script>');\n" + RESOURCE_CONTENT_DEB + ";\n", getContent(actual)); }
@Test public void testGetJsContentWithOpt() throws Exception { JsUri jsUri = mockJsUri(false); FeatureResource extRes = mockResource(true, RESOURCE_URL_DEB, RESOURCE_URL_OPT); FeatureResource intRes = mockResource(false, RESOURCE_CONTENT_DEB, RESOURCE_CONTENT_OPT); FeatureBundle bundle = mockBundle(Lists.newArrayList(extRes, intRes)); Iterable<JsContent> actual = compiler.getJsContent(jsUri, bundle); assertEquals( "document.write('<script src=\"" + RESOURCE_URL_OPT + "\"></script>');\n" + RESOURCE_CONTENT_OPT + ";\n", getContent(actual)); }