// Path: src/test/java/org/springframework/extensions/workflow/TransitionHolder.java
// public class TransitionHolder {
//     private String lastTransitionId;
//     private Object[] lastTransitionArguments = new Object[0];
// 
//     public String getLastTransitionId() {
//         return lastTransitionId;
//     }
// 
//     public void setLastTransitionId(String lastTransitionId) {
//         this.lastTransitionId = lastTransitionId;
//     }
// 
//     public Object[] getLastTransitionArguments() {
//         return lastTransitionArguments;
//     }
// 
//     public void setLastTransitionArguments(Object... lastTransitionArguments) {
//         this.lastTransitionArguments = lastTransitionArguments;
//     }
// 
//     @Override
//     public String toString() {
//         final StringBuilder sb = new StringBuilder();
//         sb.append(this.lastTransitionId).append("(");
//         for (int i = 0; i < this.lastTransitionArguments.length - 1; i++) {
//             if (i > 0) sb.append(", ");
//             sb.append(this.lastTransitionArguments[i]);
//         }
//         sb.append(")");
//         return sb.toString();
//     }
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// @SuppressWarnings({"unchecked"})
// public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//     return (T) getStrategy().getDescriptor();
// }


import org.springframework.extensions.workflow.TransitionHolder;
import org.springframework.extensions.workflow.annotation.State;
import org.springframework.extensions.workflow.annotation.Transition;
import org.springframework.extensions.workflow.annotation.ReturnsState;
import static org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder.getFlowInstanceDescriptor;
package org.springframework.extensions.workflow.flow;


/**
 * @author janm
 */
@State(end = true)
public class EndState {
    private TransitionHolder lastTransition;

    @Transition
    @ReturnsState
    public String one(String to) {
        LongFlowInstanceDescriptor d = getFlowInstanceDescriptor();
        d.setSomeValue(3L);
        
        this.lastTransition.setLastTransitionId("EndState.end");
        return to;
    }

    @Transition(to = "start")
    public void restart(int i) {
        this.lastTransition.setLastTransitionId("EndState.restart");
        this.lastTransition.setLastTransitionArguments(i);
// Path: src/test/java/org/springframework/extensions/workflow/TransitionHolder.java
// public class TransitionHolder {
//     private String lastTransitionId;
//     private Object[] lastTransitionArguments = new Object[0];
// 
//     public String getLastTransitionId() {
//         return lastTransitionId;
//     }
// 
//     public void setLastTransitionId(String lastTransitionId) {
//         this.lastTransitionId = lastTransitionId;
//     }
// 
//     public Object[] getLastTransitionArguments() {
//         return lastTransitionArguments;
//     }
// 
//     public void setLastTransitionArguments(Object... lastTransitionArguments) {
//         this.lastTransitionArguments = lastTransitionArguments;
//     }
// 
//     @Override
//     public String toString() {
//         final StringBuilder sb = new StringBuilder();
//         sb.append(this.lastTransitionId).append("(");
//         for (int i = 0; i < this.lastTransitionArguments.length - 1; i++) {
//             if (i > 0) sb.append(", ");
//             sb.append(this.lastTransitionArguments[i]);
//         }
//         sb.append(")");
//         return sb.toString();
//     }
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// @SuppressWarnings({"unchecked"})
// public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//     return (T) getStrategy().getDescriptor();
// }


// Path: src/test/java/org/springframework/extensions/workflow/flow/EndState.java
import org.springframework.extensions.workflow.TransitionHolder;
import org.springframework.extensions.workflow.annotation.State;
import org.springframework.extensions.workflow.annotation.Transition;
import org.springframework.extensions.workflow.annotation.ReturnsState;
import static org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder.getFlowInstanceDescriptor;

package org.springframework.extensions.workflow.flow;


/**
 * @author janm
 */
@State(end = true)
public class EndState {
    private TransitionHolder lastTransition;

    @Transition
    @ReturnsState
    public String one(String to) {
        LongFlowInstanceDescriptor d = getFlowInstanceDescriptor();
        d.setSomeValue(3L);
        
        this.lastTransition.setLastTransitionId("EndState.end");
        return to;
    }

    @Transition(to = "start")
    public void restart(int i) {
        this.lastTransition.setLastTransitionId("EndState.restart");
        this.lastTransition.setLastTransitionArguments(i);
        LongFlowInstanceDescriptor d = getFlowInstanceDescriptor();