public
    @Override
    String toString() {
        StringBuilder b = new StringBuilder("chain '");
        b.append(getId().stringValue());
        b.append("' [");
        appendComponent(0, b);
        appendComponent(1, b);
        if (components().size() > 3)
            b.append("... -> ");
        if (components().size() > 2)
            appendComponent(components().size() - 1, b);
        b.append("]");
        return b.toString();
    }
Create a chain by using a builder. This will order the chain by the ordering constraints.
container-core/src/main/java/com/yahoo/component/chain/Chain.java