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;
    }
@Test(expected=IllegalStateException.class)
    public void testNullEnvironment() {
        new EnvironmentFilter(){}.getEnvironment();
    }