src/main/java/com/github/oxo42/stateless4j/StateConfiguration.java
public StateConfiguration<S, T> substateOf(S superstate) {
        StateRepresentation<S, T> superRepresentation = lookup.call(superstate);
        representation.setSuperstate(superRepresentation);
        superRepresentation.addSubstate(representation);
        return this;
    }
public StateConfiguration<S, T> substateOf(S superstate) {
        StateRepresentation<S, T> superRepresentation = lookup.call(superstate);
        representation.setSuperstate(superRepresentation);
        superRepresentation.addSubstate(representation);
        return this;
    }
Sets the superstate that the configured state is a substate of
<p>
Substates inherit the allowed transitions of their superstate.
When entering directly into a substate from outside of the superstate,
entry actions for the superstate are executed.
Likewise when leaving from the substate to outside the supserstate,
exit actions for the superstate will execute.

@param superstate The superstate
@return The receiver