visualization/visualization-model/src/main/java/se/jguru/nazgul/tools/visualization/model/diagram/statement/Statements.java
@SuppressWarnings("PMD")
    public void add(final Statement... toAdd) {

        if (toAdd != null) {

            Arrays.stream(toAdd)
                    .filter(Objects::nonNull)
                    .forEach(c -> {

                        // Resolve the type of the current Statement, and assign it to
                        // the appropriate internal state.
                        if (c instanceof CommonEdgeAttributes) {
                            this.commonEdgeAttributes = (CommonEdgeAttributes) c;
                        } else if (c instanceof CommonGraphAttributes) {
                            this.commonGraphAttributes = (CommonGraphAttributes) c;
                        } else if (c instanceof CommonNodeAttributes) {
                            this.commonNodeAttributes = (CommonNodeAttributes) c;
                        } else if (c instanceof Node) {
                            this.nodes.add((Node) c);
                        } else if (c instanceof Identifier) {
                            this.identifiers.add((Identifier) c);
                        } else if (c instanceof Edge) {
                            this.edges.add((Edge) c);
                        } else if (c instanceof Subgraph) {
                            this.subgraphs.add((Subgraph) c);
                        }
                    });
        }
    }
@SuppressWarnings("PMD")
    public void add(final Statement... toAdd) {

        if (toAdd != null) {

            Arrays.stream(toAdd)
                    .filter(Objects::nonNull)
                    .forEach(c -> {

                        // Resolve the type of the current Statement, and assign it to
                        // the appropriate internal state.
                        if (c instanceof CommonEdgeAttributes) {
                            this.commonEdgeAttributes = (CommonEdgeAttributes) c;
                        } else if (c instanceof CommonGraphAttributes) {
                            this.commonGraphAttributes = (CommonGraphAttributes) c;
                        } else if (c instanceof CommonNodeAttributes) {
                            this.commonNodeAttributes = (CommonNodeAttributes) c;
                        } else if (c instanceof Node) {
                            this.nodes.add((Node) c);
                        } else if (c instanceof Identifier) {
                            this.identifiers.add((Identifier) c);
                        } else if (c instanceof Edge) {
                            this.edges.add((Edge) c);
                        } else if (c instanceof Subgraph) {
                            this.subgraphs.add((Subgraph) c);
                        }
                    });
        }
    }
@ SuppressWarnings ( "PMD" ) public void add ( final Statement ... toAdd ) { if ( toAdd != null ) { Arrays . stream ( toAdd ) . filter ( Objects :: nonNull ) . forEach ( c -> { // Resolve the type of the current Statement, and assign it to // the appropriate internal state. if ( c instanceof CommonEdgeAttributes ) { this . commonEdgeAttributes = ( CommonEdgeAttributes ) c ; } else if ( c instanceof CommonGraphAttributes ) { this . commonGraphAttributes = ( CommonGraphAttributes ) c ; } else if ( c instanceof CommonNodeAttributes ) { this . commonNodeAttributes = ( CommonNodeAttributes ) c ; } else if ( c instanceof Node ) { this . nodes . add ( ( Node ) c ) ; } else if ( c instanceof Identifier ) { this . identifiers . add ( ( Identifier ) c ) ; } else if ( c instanceof Edge ) { this . edges . add ( ( Edge ) c ) ; } else if ( c instanceof Subgraph ) { this . subgraphs . add ( ( Subgraph ) c ) ; } } ) ; } }
Adds one or more {@link Statement} objects to this {@link Statements} holder.

@param toAdd One or more {@link Statement} instances.
Adds one or more { @link Statement } objects to this { @link Statements } holder .