code: public <T> T getState(final Flow flow, final String stateId, final Class<T> clazz) {
          if (containsFlowState(flow, stateId)) {
              val state = flow.getState(stateId);
              return clazz.cast(state);
          }
          return null;
      }
docs: Gets state.
  
  @param <T>     the type parameter
  @param flow    the flow
  @param stateId the state id
  @param clazz   the clazz
  @return the state