@Override
    public void evaluate(AuthorizationContext context) {
        if (StringUtils.isBlank(context.getChannelId())) {
            this.doEvaluate(context);
            return;
        }
        Pair<Boolean, AuthorizationException> result = this.authCache.get(buildKey(context), key -> {
            try {
                this.doEvaluate(context);
                return Pair.of(true, null);
            } catch (AuthorizationException ex) {
                return Pair.of(false, ex);
            }
        });
        if (result != null && result.getObject1() == Boolean.FALSE) {
            throw result.getObject2();
        }
    }
@Test
    public void testEvaluateChannelIdBlankDoesNotUseCache() {
        AuthorizationContext context = mock(AuthorizationContext.class);
        when(context.getChannelId()).thenReturn(null);
        statefulAuthorizationStrategy.evaluate(context);
        verify(statefulAuthorizationStrategy, times(1)).doEvaluate(context);
    }