// Path: src/main/java/org/springframework/extensions/workflow/instance/FlowInstanceDescriptorSource.java
// public interface FlowInstanceDescriptorSource {
// 
//     FlowInstanceDescriptor createDescriptor();
// 
// }


import org.springframework.util.Assert;
import org.springframework.extensions.workflow.instance.FlowInstanceDescriptorSource;
import java.util.Set;
import java.util.HashSet;
import java.io.Serializable;

    public FlowDefinition(Set<StateDefinition> stateDefinitions) {
        this.stateDefinitions = stateDefinitions;
    }

    public FlowInstanceDescriptorSource getFlowInstanceDescriptorSource() {
        return flowInstanceDescriptorSource;
    }

    public void setFlowInstanceDescriptorSource(FlowInstanceDescriptorSource flowInstanceDescriptorSource) {
        this.flowInstanceDescriptorSource = flowInstanceDescriptorSource;
    }

    public Set<StateDefinition> getStates() {
        return stateDefinitions;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void addState(StateDefinition stateDefinition) {
        if (this.stateDefinitions.contains(stateDefinition)) {
            throw new DuplicateStateDefinitionException("State definition " + stateDefinition + " already exists.", stateDefinition);
        }
        this.stateDefinitions.add(stateDefinition);
// Path: src/main/java/org/springframework/extensions/workflow/instance/FlowInstanceDescriptorSource.java
// public interface FlowInstanceDescriptorSource {
// 
//     FlowInstanceDescriptor createDescriptor();
// 
// }


// Path: src/main/java/org/springframework/extensions/workflow/FlowDefinition.java
import org.springframework.util.Assert;
import org.springframework.extensions.workflow.instance.FlowInstanceDescriptorSource;
import java.util.Set;
import java.util.HashSet;
import java.io.Serializable;


    public FlowDefinition(Set<StateDefinition> stateDefinitions) {
        this.stateDefinitions = stateDefinitions;
    }

    public FlowInstanceDescriptorSource getFlowInstanceDescriptorSource() {
        return flowInstanceDescriptorSource;
    }

    public void setFlowInstanceDescriptorSource(FlowInstanceDescriptorSource flowInstanceDescriptorSource) {
        this.flowInstanceDescriptorSource = flowInstanceDescriptorSource;
    }

    public Set<StateDefinition> getStates() {
        return stateDefinitions;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void addState(StateDefinition stateDefinition) {
        if (this.stateDefinitions.contains(stateDefinition)) {
            throw new DuplicateStateDefinitionException("State definition " + stateDefinition + " already exists.", stateDefinition);
        }
        this.stateDefinitions.add(stateDefinition);
        verifySingleStart();