class UserController {

    @RequestMapping(value = "role/{role}", method = RequestMethod.GET)
    public Boolean claimContainsRole(@PathVariable final String role,
        final HttpServletRequest request) {

        final Claims claims = (Claims) request.getAttribute(JwtFilter.ATTRIBUTE_CLAIMS);

        if (claims == null || claims.isEmpty()) {
            return false;
        }

        return getRoles(claims).stream().anyMatch(map -> map.containsValue(role));
    }

    @Autowired  UserController(final UserService userService, final AuthenticationService authenticationService);

}