// Path: src/main/java/se/fearless/fettle/Action.java
// public interface Action<S, E, C> {
// 	/**
// 	 * Called when a transition occurs
// 	 * @param from the state the machine was in before the transition
// 	 * @param to the state the machine is in after the transition
// 	 * @param causedBy the event that triggered the transition
// 	 * @param context the context in which the event was fired supplied to the transition
// 	 * @param stateMachine the machine for which the transition occurred
// 	 */
// 	void onTransition(S from, S to, E causedBy, C context, StateMachine<S, E, C> stateMachine);
// }
// 
// Path: src/main/java/se/fearless/fettle/Condition.java
// public interface Condition<C> {
// 	boolean isSatisfied(C context);
// }
// 
// Path: src/main/java/se/fearless/fettle/StateMachine.java
// public interface StateMachine<S, E, C> {
// 	/**
// 	 * Gets the current state of the machine
// 	 *
// 	 * @return the state the machine is currently in
// 	 */
// 	S getCurrentState();
// 
// 	/**
// 	 * Fires an event at the state machine, possibly triggering a state change
// 	 *
// 	 * @param event the event that is fired
// 	 * @return true if the event resulted in a state change, false otherwise
// 	 */
// 	boolean fireEvent(E event);
// 
// 	/**
// 	 * Fires an event at the state machine, possibly triggering a state change
// 	 *
// 	 * @param event the event that is fired
// 	 * @param context  the context to be sent to any actions that are run on a state change. Used to supply parameters to
// 	 *                 actions and conditions
// 	 * @return true if the event resulted in a state change, false otherwise
// 	 */
// 	boolean fireEvent(E event, C context);
// 
// 	/**
// 	 * Sets the state of the state machine to the rawState even if there are no transitions leading to it
// 	 * No transition, entry or exit actions are run
// 	 *
// 	 * @param rawState the state the machine will be in after this method is called
// 	 */
// 	void rawSetState(S rawState);
// 
// 	/**
// 	 * Forces the state machine to enter the forcedState even if there are no transitions leading to it
// 	 * No transition actions are run but exit actions on the current state and entry actions on the new state are run
// 	 *
// 	 * @param forcedState the state the machine will be in after this method is called
// 	 * @return true if the state machine changed state
// 	 */
// 	boolean forceSetState(S forcedState);
// 
// 	/**
// 	 * Returns all possible transitions from a given state grouped by the event that triggers the transition.
// 	 * @param fromState the state to retrieve the outgoing transitions from.
// 	 * @return a map from all registered events in the fromState to the transitions they would trigger if fired.
// 	 */
// 	Map<E, Collection<? extends Transition<S, E, C>>> getPossibleTransitions(S fromState);
// }
// 
// Path: src/main/java/se/fearless/fettle/Transition.java
// public interface Transition<S, E, C> {
// 	S getTo();
// 
// 	boolean isSatisfied(C context);
// 
// 	void onTransition(S from, S to, E event, C context, StateMachine<S, E, C> statemachine);
// 
// 	boolean shouldExecuteEntryAndExitActions();
// }
// 
// Path: src/main/java/se/fearless/fettle/util/GuavaReplacement.java
// public class GuavaReplacement {
// 	private GuavaReplacement() {
// 	}
// 
// 	public static <T> List<T> newArrayList() {
// 		return new ArrayList<>();
// 	}
// 
// 	public static <K, V> Map<K, V> newHashMap() {
// 		return new HashMap<>();
// 	}
// }


import se.fearless.fettle.Action;
import se.fearless.fettle.Condition;
import se.fearless.fettle.StateMachine;
import se.fearless.fettle.Transition;
import se.fearless.fettle.util.GuavaReplacement;
import java.util.Collection;
package se.fearless.fettle.impl;



public abstract class AbstractTransition<S, E, C> implements Transition<S, E, C> {
	protected final S to;
	protected final Condition<C> condition;
// Path: src/main/java/se/fearless/fettle/Action.java
// public interface Action<S, E, C> {
// 	/**
// 	 * Called when a transition occurs
// 	 * @param from the state the machine was in before the transition
// 	 * @param to the state the machine is in after the transition
// 	 * @param causedBy the event that triggered the transition
// 	 * @param context the context in which the event was fired supplied to the transition
// 	 * @param stateMachine the machine for which the transition occurred
// 	 */
// 	void onTransition(S from, S to, E causedBy, C context, StateMachine<S, E, C> stateMachine);
// }
// 
// Path: src/main/java/se/fearless/fettle/Condition.java
// public interface Condition<C> {
// 	boolean isSatisfied(C context);
// }
// 
// Path: src/main/java/se/fearless/fettle/StateMachine.java
// public interface StateMachine<S, E, C> {
// 	/**
// 	 * Gets the current state of the machine
// 	 *
// 	 * @return the state the machine is currently in
// 	 */
// 	S getCurrentState();
// 
// 	/**
// 	 * Fires an event at the state machine, possibly triggering a state change
// 	 *
// 	 * @param event the event that is fired
// 	 * @return true if the event resulted in a state change, false otherwise
// 	 */
// 	boolean fireEvent(E event);
// 
// 	/**
// 	 * Fires an event at the state machine, possibly triggering a state change
// 	 *
// 	 * @param event the event that is fired
// 	 * @param context  the context to be sent to any actions that are run on a state change. Used to supply parameters to
// 	 *                 actions and conditions
// 	 * @return true if the event resulted in a state change, false otherwise
// 	 */
// 	boolean fireEvent(E event, C context);
// 
// 	/**
// 	 * Sets the state of the state machine to the rawState even if there are no transitions leading to it
// 	 * No transition, entry or exit actions are run
// 	 *
// 	 * @param rawState the state the machine will be in after this method is called
// 	 */
// 	void rawSetState(S rawState);
// 
// 	/**
// 	 * Forces the state machine to enter the forcedState even if there are no transitions leading to it
// 	 * No transition actions are run but exit actions on the current state and entry actions on the new state are run
// 	 *
// 	 * @param forcedState the state the machine will be in after this method is called
// 	 * @return true if the state machine changed state
// 	 */
// 	boolean forceSetState(S forcedState);
// 
// 	/**
// 	 * Returns all possible transitions from a given state grouped by the event that triggers the transition.
// 	 * @param fromState the state to retrieve the outgoing transitions from.
// 	 * @return a map from all registered events in the fromState to the transitions they would trigger if fired.
// 	 */
// 	Map<E, Collection<? extends Transition<S, E, C>>> getPossibleTransitions(S fromState);
// }
// 
// Path: src/main/java/se/fearless/fettle/Transition.java
// public interface Transition<S, E, C> {
// 	S getTo();
// 
// 	boolean isSatisfied(C context);
// 
// 	void onTransition(S from, S to, E event, C context, StateMachine<S, E, C> statemachine);
// 
// 	boolean shouldExecuteEntryAndExitActions();
// }
// 
// Path: src/main/java/se/fearless/fettle/util/GuavaReplacement.java
// public class GuavaReplacement {
// 	private GuavaReplacement() {
// 	}
// 
// 	public static <T> List<T> newArrayList() {
// 		return new ArrayList<>();
// 	}
// 
// 	public static <K, V> Map<K, V> newHashMap() {
// 		return new HashMap<>();
// 	}
// }


// Path: src/main/java/se/fearless/fettle/impl/AbstractTransition.java
import se.fearless.fettle.Action;
import se.fearless.fettle.Condition;
import se.fearless.fettle.StateMachine;
import se.fearless.fettle.Transition;
import se.fearless.fettle.util.GuavaReplacement;
import java.util.Collection;

package se.fearless.fettle.impl;



public abstract class AbstractTransition<S, E, C> implements Transition<S, E, C> {
	protected final S to;
	protected final Condition<C> condition;
	protected final Collection<Action<S, E, C>> actions = GuavaReplacement.newArrayList();