### Question:
EnvironmentFilter extends SecurityFilter { public Environment getEnvironment() { if (this.environment == null) { String msg = "Environment has not yet been set. This should be done before this broker filter is used."; throw new IllegalStateException(msg); } return environment; } EnvironmentFilter(); Environment getEnvironment(); void setEnvironment(Environment environment);  }### Answer:
@Test(expected=IllegalStateException.class) public void testNullEnvironment() { new EnvironmentFilter(){}.getEnvironment(); }