@SuppressWarnings("unchecked")
	public void start() {
		if(hasStarted()) {
			throw new IllegalStateException("Machine has already started.");
		}
		if(stateGraph == null) {
			throw new IllegalStateException("No state graph specified.");
		}
		if(stateGraph.getStartState()==null) {
			throw new IllegalStateException("No start state specified.");
		}

		stateGraph.onStart();

		enterState(null, stateGraph.getStartState());
	}