public Maybe<String> getValidScope(String scope, String clientId) {
        return DBManagerFactory.getInstance()
                .findClientCredentials(clientId)
                .map(creds -> getValidScopeByScope(scope, creds.getScope()));
    }
public Maybe < String > getValidScope ( String scope , String clientId ) { return DBManagerFactory . getInstance ( ) . findClientCredentials ( clientId ) . map ( creds -> getValidScopeByScope ( scope , creds . getScope ( ) ) ) ; }
Checks whether a scope is valid for a given client id.

@param scope    oauth scope
@param clientId client id
@return the scope if it is valid, otherwise returns null