public static boolean isValidScopeToken(String scopeToken) {
    return VALID_SCOPE_TOKEN.matcher(scopeToken).matches();
  }
@Test
  public void testOAuthScopeTokenValidation() {
    // valid scope tokens are from ascii 0x21 to 0x7E, excluding 0x22 (") and 0x5C (\)
    // test characters that are outside of the ! to ~ range and the excluded characters, " and \
    assertThat(OAuth2Util.isValidScopeToken("a\\b"))
        .as("Should reject scope token with \\")
        .isFalse();
    assertThat(OAuth2Util.isValidScopeToken("a b"))
        .as("Should reject scope token with space")
        .isFalse();
    assertThat(OAuth2Util.isValidScopeToken("a\"b"))
        .as("Should reject scope token with \"")
        .isFalse();
    assertThat(OAuth2Util.isValidScopeToken("\u007F"))
        .as("Should reject scope token with DEL")
        .isFalse();
    // test all characters that are inside of the ! to ~ range and are not excluded
    assertThat(OAuth2Util.isValidScopeToken("!#$%&'()*+,-./"))
        .as("Should accept scope token with !-/")
        .isTrue();
    assertThat(OAuth2Util.isValidScopeToken("0123456789"))
        .as("Should accept scope token with 0-9")
        .isTrue();
    assertThat(OAuth2Util.isValidScopeToken(":;<=>?@"))
        .as("Should accept scope token with :-@")
        .isTrue();
    assertThat(OAuth2Util.isValidScopeToken("ABCDEFGHIJKLM"))
        .as("Should accept scope token with A-M")
        .isTrue();
    assertThat(OAuth2Util.isValidScopeToken("NOPQRSTUVWXYZ"))
        .as("Should accept scope token with N-Z")
        .isTrue();
    assertThat(OAuth2Util.isValidScopeToken("[]^_`"))
        .as("Should accept scope token with [-`, not \\")
        .isTrue();
    assertThat(OAuth2Util.isValidScopeToken("abcdefghijklm"))
        .as("Should accept scope token with a-m")
        .isTrue();
    assertThat(OAuth2Util.isValidScopeToken("nopqrstuvwxyz"))
        .as("Should accept scope token with n-z")
        .isTrue();
    assertThat(OAuth2Util.isValidScopeToken("{|}~"))
        .as("Should accept scope token with {-~")
        .isTrue();
  }