ClosureRequireDependencyManager { public Collection<Node> getTransitiveDependenciesFor(String moduleId, boolean includeSelf) { Node module = getNode(moduleId); LinkedHashSet<Node> dependencies = new LinkedHashSet<Node>(); for (String dependencyId : module.dependencyIds) { dependencies.addAll(getTransitiveDependenciesFor(dependencyId, false)); dependencies.add(getNode(dependencyId)); } return dependencies; }  @Nonnull Node addFile(@Nonnull String path, @Nonnull File javascriptFile, @Nonnull Set<String> notMinimized); @Nonnull Node addFile(@Nonnull String path, @Nonnull String javascript, @Nonnull Set<String> notMinimized); Collection<Node> getTransitiveDependenciesFor(String moduleId, boolean includeSelf); Set<String> getAllModuleIds(); Node getNode(String moduleId); void validateGraph();  }
@Test public void testIsMinimized() throws Exception { List<String> a1Deps = Arrays.asList("3a", "2b", "3c", "3b", "2a"); Collection<ClosureRequireDependencyManager.Node> depNodes = _depManager.getTransitiveDependenciesFor("1a", false); List<String> actualIds = Lists.transform(Lists.newArrayList(depNodes), new Function<ClosureRequireDependencyManager.Node, String>() { @Nullable @Override public String apply(@Nonnull ClosureRequireDependencyManager.Node input) { return input.id; } }); assertEquals(a1Deps, actualIds); a1Deps = Arrays.asList("3c", "3a", "2b", "3b", "2a", "1a"); depNodes = _depManager.getTransitiveDependenciesFor("1b", false); actualIds = Lists.transform(Lists.newArrayList(depNodes), new Function<ClosureRequireDependencyManager.Node, String>() { @Nullable @Override public String apply(@Nonnull ClosureRequireDependencyManager.Node input) { return input.id; } }); assertEquals(a1Deps, actualIds); }