private boolean seenInDictionary(final List<Token> tokens) {
        if (tokens.isEmpty()) {
            return false;
        } else {
            // Last token may be a string if we are part way through the dict name
            return containsTailElements(
                    tokens,
                    Token::getTokenType,
                    TokenType.IN,
                    TokenType.WHITESPACE,
                    TokenType.DICTIONARY,
                    TokenType.WHITESPACE)
                   || containsTailElements(
                    tokens,
                    Token::getTokenType,
                    TokenType.IN,
                    TokenType.WHITESPACE,
                    TokenType.DICTIONARY,
                    TokenType.WHITESPACE,
                    TokenType.STRING);
        }
    }
Here to help testing, so we don't have to work out the row/col postitions
stroom-query/stroom-query-impl/src/main/java/stroom/query/impl/QueryServiceImpl.java