private static PrintableNode convertNode(final ExpressionItem oldNode, final Set<String> fieldBlackList) {
        PrintableNode newNode = null;

        if (oldNode.enabled()) {
            if (oldNode instanceof ExpressionTerm) {
                final ExpressionTerm termNode = (ExpressionTerm) oldNode;
                if (termNode.getValue() != null && termNode.getValue().length() > 0) {
                    newNode = convertTermNode(termNode, fieldBlackList);
                }
            } else if (oldNode instanceof ExpressionOperator) {
                newNode = convertOperatorNode((ExpressionOperator) oldNode, fieldBlackList);
            } else {
                throw new RuntimeException("Node is of a type that we don't expect: " + oldNode.getClass().getName());
            }
        }

        // the node is disabled so just return null rather than including it
        // in the new tree
        return newNode;
    }
Converts a tree of {@link ExpressionItem} objects into a
{@link FilterTermsTree}. Conversion is not exact as some features of the
{@link ExpressionItem} tree are not supported so it may throw a
{@link RuntimeException}.

@param rootItem The {@link ExpressionItem} object that is the root of the tree
@return A {@link FilterTermsTree} object containing a tree of
{@link PrintableNode} objects
stroom-statistics/stroom-statistics-impl-sql/src/main/java/stroom/statistics/impl/sql/search/FilterTermsTreeBuilder.java