PropertyFeatureProvider implements FeatureProvider { @Override public FeatureMetaData getMetaData(Feature feature) { return metadata.get(feature.name()); } PropertyFeatureProvider(Properties properties); @Override Set<Feature> getFeatures(); @Override FeatureMetaData getMetaData(Feature feature);  }
@Test public void shouldNotAllowTheDefaultFeatureStateToBeChangedByExternalClasses() { Properties properties = new Properties(); properties.setProperty("F1", ""); PropertyFeatureProvider provider = new PropertyFeatureProvider(properties); FeatureMetaData metadata = provider.getMetaData(new NamedFeature("F1")); assertFalse(metadata.getDefaultFeatureState().isEnabled()); metadata.getDefaultFeatureState().setEnabled(true); assertFalse(provider.getMetaData(new NamedFeature("F1")).getDefaultFeatureState().isEnabled()); }