visualization/visualization-api/src/main/java/se/jguru/nazgul/tools/visualization/api/dot/StatementsRenderer.java
@Override
    protected String doRender(final RenderConfiguration config, final Statements statements) {

        final StringBuilder builder = new StringBuilder(config.getIndent());

        // #1) Render the AttributeStatements plus comment, if they exist.
        final boolean hasAttributeStatements = statements.getCommonGraphAttributes() != null
                || statements.getCommonNodeAttributes() != null
                || statements.getCommonEdgeAttributes() != null;

        if (hasAttributeStatements) {

            // Add the comment first.
            builder.append(commentRenderer.render(config, statements.getCommonAttributesComment()));

            // Add the attributes in order
            if (statements.getCommonGraphAttributes() != null) {
                builder.append(commonGraphAttributesRenderer.render(config, statements.getCommonGraphAttributes()));
            }

            if (statements.getCommonNodeAttributes() != null) {
                builder.append(commonNodeAttributesRenderer.render(config, statements.getCommonNodeAttributes()));
            }

            if (statements.getCommonEdgeAttributes() != null) {
                builder.append(commonEdgeAttributesRenderer.render(config, statements.getCommonEdgeAttributes()));
            }
        }

        // #2) Render the other Statements in order, namely
        //
        //     Node statements
        //     Identifier statements
        //     Edge statements
        //     Subgraph statements
        final List<Node> nodes = statements.getNodes();
        if (!nodes.isEmpty()) {

            builder.append(commentRenderer.render(config, statements.getNodesComment()));

            // Render all Nodes in order.
            nodes.forEach(n -> builder.append(nodeRenderer.render(config, n)));
        }

        final List<Identifier> identifiers = statements.getIdentifiers();
        if (!identifiers.isEmpty()) {

            builder.append(commentRenderer.render(config, statements.getIdentifiersComment()));

            // Render all Identifiers in order.
            identifiers.forEach(i -> builder.append(identifierRenderer.render(config, i)));
        }

        final List<Edge> edges = statements.getEdges();
        if (edges != null && !edges.isEmpty()) {

            builder.append(commentRenderer.render(config, statements.getEdgesComment()));

            // Render all Edges in order.
            edges.forEach(i -> builder.append(edgeRenderer.render(config, i)));
        }

        final List<Subgraph> subgraphs = statements.getSubgraphs();
        if (!subgraphs.isEmpty()) {

            builder.append(commentRenderer.render(config, statements.getSubgraphComment()));

            // Render all Subgraphs in order.
            subgraphs.forEach(s -> builder.append(subgraphRenderer.render(config, s)));
        }

        // All Done.
        return builder.toString();
    }
@Override
    protected String doRender(final RenderConfiguration config, final Statements statements) {

        final StringBuilder builder = new StringBuilder(config.getIndent());

        // #1) Render the AttributeStatements plus comment, if they exist.
        final boolean hasAttributeStatements = statements.getCommonGraphAttributes() != null
                || statements.getCommonNodeAttributes() != null
                || statements.getCommonEdgeAttributes() != null;

        if (hasAttributeStatements) {

            // Add the comment first.
            builder.append(commentRenderer.render(config, statements.getCommonAttributesComment()));

            // Add the attributes in order
            if (statements.getCommonGraphAttributes() != null) {
                builder.append(commonGraphAttributesRenderer.render(config, statements.getCommonGraphAttributes()));
            }

            if (statements.getCommonNodeAttributes() != null) {
                builder.append(commonNodeAttributesRenderer.render(config, statements.getCommonNodeAttributes()));
            }

            if (statements.getCommonEdgeAttributes() != null) {
                builder.append(commonEdgeAttributesRenderer.render(config, statements.getCommonEdgeAttributes()));
            }
        }

        // #2) Render the other Statements in order, namely
        //
        //     Node statements
        //     Identifier statements
        //     Edge statements
        //     Subgraph statements
        final List<Node> nodes = statements.getNodes();
        if (!nodes.isEmpty()) {

            builder.append(commentRenderer.render(config, statements.getNodesComment()));

            // Render all Nodes in order.
            nodes.forEach(n -> builder.append(nodeRenderer.render(config, n)));
        }

        final List<Identifier> identifiers = statements.getIdentifiers();
        if (!identifiers.isEmpty()) {

            builder.append(commentRenderer.render(config, statements.getIdentifiersComment()));

            // Render all Identifiers in order.
            identifiers.forEach(i -> builder.append(identifierRenderer.render(config, i)));
        }

        final List<Edge> edges = statements.getEdges();
        if (edges != null && !edges.isEmpty()) {

            builder.append(commentRenderer.render(config, statements.getEdgesComment()));

            // Render all Edges in order.
            edges.forEach(i -> builder.append(edgeRenderer.render(config, i)));
        }

        final List<Subgraph> subgraphs = statements.getSubgraphs();
        if (!subgraphs.isEmpty()) {

            builder.append(commentRenderer.render(config, statements.getSubgraphComment()));

            // Render all Subgraphs in order.
            subgraphs.forEach(s -> builder.append(subgraphRenderer.render(config, s)));
        }

        // All Done.
        return builder.toString();
    }
{@inheritDoc}