public static List<String> parseScope(String spaceDelimitedScope) throws OAuthBearerConfigException {
        List<String> retval = new ArrayList<>();
        for (String individualScopeItem : Objects.requireNonNull(spaceDelimitedScope).split(" ")) {
            if (!individualScopeItem.isEmpty()) {
                if (!isValidScopeItem(individualScopeItem))
                    throw new OAuthBearerConfigException(String.format("Invalid scope value: %s", individualScopeItem));
                retval.add(individualScopeItem);
            }
        }
        return Collections.unmodifiableList(retval);
    }
@Test
    public void validScope() {
        for (String validScope : new String[] {"", "   ", "scope1", " scope1 ", "scope1 Scope2", "scope1   Scope2"}) {
            List<String> parsedScope = OAuthBearerScopeUtils.parseScope(validScope);
            if (Utils.isBlank(validScope)) {
                assertTrue(parsedScope.isEmpty());
            } else if (validScope.contains("Scope2")) {
                assertTrue(parsedScope.size() == 2 && parsedScope.get(0).equals("scope1")
                        && parsedScope.get(1).equals("Scope2"));
            } else {
                assertTrue(parsedScope.size() == 1 && parsedScope.get(0).equals("scope1"));
            }
        }
    }