ConjunctAuthScopeExpression extends AbstractAuthScopeExpression { @Override public String toLoggingForm() { return "(" + Joiner.on(" && ") .join(Iterables.transform(innerExpressions, new Function<AuthScopeExpression, String>() { @Override public String apply(AuthScopeExpression scopeExpression) { return scopeExpression.toLoggingForm(); } })) + ")"; } ConjunctAuthScopeExpression(List<SingleAuthScopeExpression> innerExpressions); @Override String[] getAllScopes(); @Override boolean isAuthorized(Set<String> userScopes); @Override String toLoggingForm(); @Override boolean equals(Object obj); @Override int hashCode();  }
@Test public void testToLoggingForm() { SingleAuthScopeExpression expression1 = new SingleAuthScopeExpression("scope1"); SingleAuthScopeExpression expression2 = new SingleAuthScopeExpression("scope2"); SingleAuthScopeExpression expression3 = new SingleAuthScopeExpression("scope3"); AuthScopeExpression expression = new ConjunctAuthScopeExpression(ImmutableList.of(expression1, expression2, expression3)); assertThat(expression.toLoggingForm()).isEqualTo("(scope1 && scope2 && scope3)"); }