protected int calculateHashCode(FeatureUser user, Feature feature) { Validate.notNull(user, "user is required"); return new StringBuilder() .append(user.getName().toLowerCase(Locale.ENGLISH).trim()) .append(":") .append(feature != null ? feature.name() : "") .toString() .hashCode(); }
public TestFeatureManager disable(Feature feature) { activeFeatures.remove(feature.name()); return this; }
public TestFeatureManager enable(Feature feature) { activeFeatures.add(feature.name()); return this; }
@Override public boolean isActive(Feature feature) { return activeFeatures.contains(feature.name()); }