ResourceRuntimeContext { public void setDeDupToken(String deDupToken) { List<String> urns = m_config.getRegistry().getTokenStorage().loadResourceUrns(deDupToken); if (urns != null) { for (String urn : urns) { if (urn.indexOf("inline:/") < 0) { m_model.setRenderedResource(urn); } } } } private  ResourceRuntimeContext(); static ResourceRuntimeContext ctx(); static boolean isInitialized(); static void reset(); @Deprecated static void setup(String contextPath); static void setup(); IResourceContext createResourceContext(); Object getAttribute(String name); IResourceRuntimeConfig getConfig(); IDeferRenderable getDeferRenderable(String key); ResourceModel getModel(); ResourceAggregator getResourceAggregator(); IResourceContext getResourceContext(); DiagnosisModel getShowDiagModel(); Statistics getStatistics(); boolean isShowDiag(); boolean isStatisticsEnabled(); void registerDeferRenderable(String key, IDeferRenderable renderable); void setAttribute(String name, Object value); String getDeDupToken(String resType); void setDeDupToken(String deDupToken); void setLocale(IResourceLocale locale); void setShowDiag(boolean showDiag); void supportDeferRendering(String uri);  }
@Test public void testSetDedupToken() { ResourceRuntimeContext ctx = ResourceRuntimeContext.ctx(); MockTokenStorage storage = new MockTokenStorage(); ctx.getConfig().getRegistry().setTokenStorage(storage); List<String> urns = new ArrayList<String>(); urns.add("js.local.sample.sample1_js"); urns.add("js.local.sample.sample2_js"); String dedupToken = storage.storeResourceUrns(urns); ctx.setDeDupToken(dedupToken); }