// Empty annotations.
annotations = new Annotation[0];
assertThat(SecurityHelper.getFilteringScopes(context, annotations), equalTo(Collections.<String>emptySet()));
// Not security annotations.
annotations = new Annotation[]{new CustomAnnotationImpl(), new CustomAnnotationImpl()};
assertThat(SecurityHelper.getFilteringScopes(context, annotations), equalTo(Collections.<String>emptySet()));
// Mixed.
annotations = new Annotation[]{new CustomAnnotationImpl(), SecurityAnnotations.rolesAllowed("manager"), new CustomAnnotationImpl()};
expected = Sets.newHashSet(RolesAllowed.class.getName() + "_manager");
assertThat(SecurityHelper.getFilteringScopes(context, annotations), equalTo(expected));
// Multiple.
annotations = new Annotation[]{SecurityAnnotations.rolesAllowed("client", "user")};