@Override
    public Set<String> scope() {
        // Immutability of the set is performed in the constructor/validation utils class, so
        // we don't need to repeat it here.
        return scopes;
    }
@Test
    public void noErrorIfModifyScope() {
        // Start with a basic set created by the caller.
        SortedSet<String> callerSet = new TreeSet<>(Arrays.asList("a", "b", "c"));
        OAuthBearerToken token = new BasicOAuthBearerToken("not.valid.token",
            callerSet,
            0L,
            "jdoe",
            0L);

        // Make sure it all looks good
        assertNotNull(token.scope());
        assertEquals(3, token.scope().size());

        // Add a value to the caller's set and note that it changes the token's scope set.
        // Make sure to make it read-only when it's passed in.
        callerSet.add("d");
        assertTrue(token.scope().contains("d"));

        // Similarly, removing a value from the caller's will affect the token's scope set.
        // Make sure to make it read-only when it's passed in.
        callerSet.remove("c");
        assertFalse(token.scope().contains("c"));

        // Ensure that attempting to change the token's scope set directly will not throw any error.
        token.scope().clear();
    }