class Sequence implements Iterable<SequenceItem> {

    public BayesianNetwork toBayesianNetwork() {
        if (containedItems.size() == 0) {
            throw new RuntimeException("Bayesian Network construction failed because the Sequence contains no SequenceItems");
        }
        Optional<Vertex<?, ?>> seedVertex = containedItems
            .get(0)
            .getContents()
            .values()
            .stream()
            .findFirst();
        if (!seedVertex.isPresent()) {
            throw new RuntimeException("Bayesian Network construction failed because there are no vertices in the Sequence");
        }
        return new BayesianNetwork(seedVertex.get().getConnectedGraph());
    }

    public  Sequence(int reservedSize, int uniqueIdentifier, String name);

}