code: public boolean scopeAllowed(String scope, String allowedScopes) {
          String[] allScopes = allowedScopes.split(SPACE);
          List<String> allowedList = Arrays.asList(allScopes);
          String[] scopes = scope.split(SPACE);
          int allowedCount = 0;
          for (String s : scopes) {
              if (allowedList.contains(s)) {
                  allowedCount++;
              }
          }
          return (allowedCount == scopes.length);
      }
docs: Checks whether a scope is contained in allowed scopes.
  
  @param scope         scope to be checked
  @param allowedScopes all allowed scopes
  @return true if the scope is allowed, otherwise false