/** * Removes the list of features for a gadget. * * @param toRemove * the features to remove. */ public void removeFeatures(Set<String> toRemove) { removeFeatures(toRemove, this.features); }
/** * Removes an feature for a gadget. * * @param toRemove * the feature to remove. */ public void removeFeature(String toRemove) { Set<String> features = createSingleFeatureSet(toRemove); removeFeatures(features, this.features); }
@Test public void testRemoveFeatures() { validateDefaultFeatures(); Set<String> toRemoveWhitelist = Sets.newHashSet(TABS, VIEWS); Set<String> toRemoveBlacklist = Sets.newHashSet(EE); whitelistData.removeFeatures(toRemoveWhitelist); blacklistData.removeFeatures(toRemoveBlacklist); nullData.removeFeatures(toRemoveWhitelist); defaultData.removeFeatures(toRemoveWhitelist); assertEquals(Sets.newHashSet(SETPREFS), whitelistData.getFeatures()); assertEquals(Sets.newHashSet(SELECTION), blacklistData.getFeatures()); assertEquals(Sets.newHashSet(), nullData.getFeatures()); assertEquals(Sets.newHashSet(), defaultData.getFeatures()); }
@Test public void testRemoveFeatures() { validateDefaultFeatures(); Set<String> toRemoveWhitelist = Sets.newHashSet(TABS, VIEWS); Set<String> toRemoveBlacklist = Sets.newHashSet(EE); whitelistData.removeFeatures(toRemoveWhitelist); blacklistData.removeFeatures(toRemoveBlacklist); nullData.removeFeatures(toRemoveWhitelist); defaultData.removeFeatures(toRemoveWhitelist); assertEquals(Sets.newHashSet(SETPREFS), whitelistData.getFeatures()); assertEquals(Sets.newHashSet(SELECTION), blacklistData.getFeatures()); assertEquals(Sets.newHashSet(), nullData.getFeatures()); assertEquals(Sets.newHashSet(), defaultData.getFeatures()); }