### Question:
ProjectFeatureFlags implements Iterable<ProjectFeatureFlag> { public boolean isEnabled(final String flagName) { notEmpty(flagName, "flagName"); for (final ProjectFeatureFlag flag : items) { if (flagName.equalsIgnoreCase(flag.getName())) { return flag.isEnabled(); } } return false; } @JsonCreator  ProjectFeatureFlags(@JsonProperty("items") List<ProjectFeatureFlag> items); @Override Iterator<ProjectFeatureFlag> iterator(); boolean isEnabled(final String flagName); @Override String toString(); static final String PROJECT_FEATURE_FLAGS_URI; }### Answer:
@Test public void isEnabledShouldReturnCorrectBoolean() throws Exception { final ProjectFeatureFlags flags = new ProjectFeatureFlags(asList( new ProjectFeatureFlag("enabledFlag", true), new ProjectFeatureFlag("disabledFlag", false) )); assertThat(flags.isEnabled("enabledFlag"), is(true)); assertThat(flags.isEnabled("disabledFlag"), is(false)); assertThat(flags.isEnabled("nonexistentFlag"), is(false)); }
@Test(expectedExceptions = IllegalArgumentException.class) public void whenNullNameThenIsEnabledShouldThrow() throws Exception { final ProjectFeatureFlags flags = new ProjectFeatureFlags( singletonList(new ProjectFeatureFlag("enabledFlag", true))); flags.isEnabled(null); }