ModuleDeps extends LinkedHashMap<String, ModuleDepInfo> implements Serializable { public boolean subtractAll(ModuleDeps toSub) { boolean modified = false; for (Map.Entry<String, ModuleDepInfo> entry : toSub.entrySet()) { modified |= subtract(entry.getKey(), entry.getValue()); } return modified; } ModuleDeps();  ModuleDeps(ModuleDeps other); boolean add(String key, ModuleDepInfo info); boolean addAll(ModuleDeps other); boolean containsDep(String moduleName, BooleanTerm term); ModuleDeps andWith(ModuleDepInfo info); boolean subtract(String key, ModuleDepInfo subInfo); boolean subtractAll(ModuleDeps toSub); Set<String> getModuleIds(); Set<String> getModuleIds(Map<?, ?> formulaCache); Map<String, String> getModuleIdsWithComments(); ModuleDeps resolveWith(Features features); ModuleDeps resolveWith(Features features, boolean coerceUndefinedToFalse); ModuleDeps simplify(Map<?, ?> formulaCache); @Override ModuleDepInfo put(String key, ModuleDepInfo value); @Override void putAll(Map<? extends String, ? extends ModuleDepInfo> map);  }
@Test public void testSubtractAll() { ModuleDeps deps = new ModuleDeps(); Assert.assertTrue(deps.add("module1", new ModuleDepInfo("has", new BooleanTerm("A"), null))); Assert.assertTrue(deps.add("module2", new ModuleDepInfo("has", new BooleanTerm("B"), null))); Assert.assertTrue(deps.add("module2", new ModuleDepInfo("has", new BooleanTerm("C"), null))); Assert.assertTrue(deps.add("module3", new ModuleDepInfo(null, BooleanTerm.TRUE, null))); Assert.assertTrue(deps.add("module4", new ModuleDepInfo("has", BooleanTerm.FALSE, null))); ModuleDeps deps2 = new ModuleDeps(); Assert.assertTrue(deps2.add("module2", new ModuleDepInfo("has", new BooleanTerm("B"), null))); Assert.assertTrue(deps2.add("module2", new ModuleDepInfo("has", new BooleanTerm("C"), null))); Assert.assertTrue(deps2.add("module3", new ModuleDepInfo(null, BooleanTerm.TRUE, null))); Assert.assertTrue(deps.subtractAll(deps2)); Assert.assertEquals(0, deps.get("module2").getHasPluginPrefixes().size()); Assert.assertEquals(0, deps.get("module3").getHasPluginPrefixes().size()); }