public static FieldPrecedenceModel newInstance(
        final String stateClassName,
        final Token msgToken,
        final List<Token> fields,
        final List<Token> groups,
        final List<Token> varData,
        final Function<IntStream, IntStream> versionsSelector)
    {
        final FieldPrecedenceModel model = new FieldPrecedenceModel(stateClassName);
        model.findTransitions(msgToken, fields, groups, varData, versionsSelector);
        return model;
    }
Builds a state machine that models whether codec interactions are safe.

@param stateClassName the qualified name of the class that models the state machine in generated code
@param msgToken the message token
@param fields the fields in the message
@param groups the groups in the message
@param varData the varData in the message
@param versionsSelector a function that selects the versions to model in the state machine
@return the access order model
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/common/FieldPrecedenceModel.java