FeatureContext { public boolean featureHasStatus(String key, FeatureStatus status) { if(key == null || "".equals(key)) { throw new IllegalArgumentException("key argument is required"); } if(hasFeature(key)) { return featureMap.get(key).getStatus() == status; } return false; } FeatureContext(Configuration config); Feature addFeature(String key); Feature addFeature(Feature feature); boolean hasFeature(String key); boolean featureHasStatus(String key, FeatureStatus status); void clear(); int size(); Configuration getConfig();  }
@Test public void featureHasStatus_WithAddedFeature_ReturnsTrue() { addFeatureToContext("test.feature", options.enabledStatus); assertTrue("feature 'test.feature' should have status enabledStatus", context.featureHasStatus("test.feature", options.enabledStatus)); }
@Test public void featureHasStatus_WithAddedFeature_ReturnsFalse() { addFeatureToContext("test.feature", options.enabledStatus); assertFalse("feature 'test.feature' should have status enabledStatus", context.featureHasStatus("test.feature", options.disabledStatus)); }
@Test(expected=IllegalArgumentException.class) public void featureHasStatus_WithoutFeatureKey_ThrowsException() { addFeatureToContext("test.feature", options.enabledStatus); context.featureHasStatus(null, options.enabledStatus); }