### Question:
DefaultResourceDependencyResolver implements ResourceDependencyResolver { public LinkedHashSet<String> getDependencies(String moduleKey, boolean excludeSuperBatchedResources) { LinkedHashSet<String> orderedResourceKeys = new LinkedHashSet<String>(); Set<String> superBatchResources = excludeSuperBatchedResources ? getSuperBatchDependencies() : Collections.<String>emptySet(); resolveDependencies(moduleKey, orderedResourceKeys, superBatchResources, new Stack<String>()); return orderedResourceKeys; } DefaultResourceDependencyResolver(WebResourceIntegration webResourceIntegration, ResourceBatchingConfiguration batchingConfiguration); LinkedHashSet<String> getSuperBatchDependencies(); LinkedHashSet<String> getDependencies(String moduleKey, boolean excludeSuperBatchedResources);  }### Answer:
@Test public void testGetDependenciesExcludesSuperBatch() { String superBatchResource1 = "test.maera:super1"; String superBatchResource2 = "test.maera:super2"; String moduleKey = "test.maera:foo"; superBatchKeys.add(superBatchResource1); superBatchKeys.add(superBatchResource2); mockWebResourceIntegration.matchAndReturn("getSuperBatchVersion", "1.0"); mockPluginAccessor.matchAndReturn("getEnabledPluginModule", C.args(C.eq(moduleKey)), TestUtils.createWebResourceModuleDescriptor(moduleKey, testPlugin, Collections.<ResourceDescriptor>emptyList(), Arrays.asList(superBatchResource1))); mockPluginAccessor.matchAndReturn("getEnabledPluginModule", C.args(C.eq(superBatchResource1)), TestUtils.createWebResourceModuleDescriptor(superBatchResource1, testPlugin)); mockPluginAccessor.matchAndReturn("getEnabledPluginModule", C.args(C.eq(superBatchResource2)), TestUtils.createWebResourceModuleDescriptor(superBatchResource2, testPlugin)); LinkedHashSet<String> resources = dependencyResolver.getDependencies(moduleKey, true); assertNotNull(resources); assertOrder(resources, moduleKey); }
@Test public void testGetDependenciesIncludesSuperBatch() { String superBatchResource1 = "test.maera:super1"; String superBatchResource2 = "test.maera:super2"; String moduleKey = "test.maera:foo"; superBatchKeys.add(superBatchResource1); superBatchKeys.add(superBatchResource2); mockWebResourceIntegration.matchAndReturn("getSuperBatchVersion", "1.0"); mockPluginAccessor.matchAndReturn("getEnabledPluginModule", C.args(C.eq(moduleKey)), TestUtils.createWebResourceModuleDescriptor(moduleKey, testPlugin, Collections.<ResourceDescriptor>emptyList(), Arrays.asList(superBatchResource1))); mockPluginAccessor.matchAndReturn("getEnabledPluginModule", C.args(C.eq(superBatchResource1)), TestUtils.createWebResourceModuleDescriptor(superBatchResource1, testPlugin)); mockPluginAccessor.matchAndReturn("getEnabledPluginModule", C.args(C.eq(superBatchResource2)), TestUtils.createWebResourceModuleDescriptor(superBatchResource2, testPlugin)); LinkedHashSet<String> resources = dependencyResolver.getDependencies(moduleKey, false); assertNotNull(resources); assertOrder(resources, superBatchResource1, moduleKey); }