### Question:
AddJslLoadedVariableProcessor implements JsProcessor { public boolean process(JsRequest jsRequest, JsResponseBuilder builder) throws JsException { JsUri jsUri = jsRequest.getJsUri(); FeatureRegistry registry = null; String repository = jsUri.getRepository(); try { registry = featureRegistryProvider.get(jsUri.getRepository()); } catch (GadgetException e) { if (LOG.isLoggable(Level.WARNING)) { LOG.log(Level.WARNING, "No registry found for repository: " + repository, e); } } if (registry != null && !jsUri.isNohint()) { Set<String> allfeatures = registry.getAllFeatureNames(); Set<String> libs = Sets.newTreeSet(); libs.addAll(jsUri.getLibs()); libs.removeAll(jsUri.getLoadedLibs()); libs.retainAll(allfeatures); String array = toArrayString(libs); builder.appendJs(String.format(TEMPLATE, array), CODE_ID, true); } return true; } @Inject  AddJslLoadedVariableProcessor(FeatureRegistryProvider featureRegistryProvider); boolean process(JsRequest jsRequest, JsResponseBuilder builder);  }### Answer:
@Test public void testSucceeds() throws Exception { setUpJsUri(URI + "/" + REQ_1_LIB + ".js"); control.replay(); processor.process(request, response); assertEquals(String.format(AddJslLoadedVariableProcessor.TEMPLATE, "['foo','gig']"), response.build().toJsString()); control.verify(); }
@Test public void testSkips() throws Exception { setUpJsUri(URI + "?nohint=1"); control.replay(); processor.process(request, response); assertEquals("", response.build().toJsString()); control.verify(); }