// 1 states :: list(state()),
// 2 transitions :: list(transition()),
// 3 initial_state :: state(),
// 4 alphabet :: list(event())
OtpErlangTuple machine = (OtpErlangTuple)obj;
if (machine.arity() != 5)
throw new IllegalArgumentException("expected 5 components in FSM");
if (!((OtpErlangAtom)machine.elementAt(0)).atomValue().equals("statemachine"))
throw new IllegalArgumentException("first element of a record should be \"statemachine\"");
OtpErlangList states = (OtpErlangList)machine.elementAt(1),transitions = (OtpErlangList)machine.elementAt(2),alphabet = (OtpErlangList)machine.elementAt(4);
OtpErlangAtom initial_state = (OtpErlangAtom)machine.elementAt(3);