public void generate() throws IOException
    {
        packageNameByTypes.clear();
        generatePackageInfo();
        generateTypeStubs();
        generateMessageHeaderStub();

        for (final List<Token> tokens : ir.messages())
        {
            final Token msgToken = tokens.get(0);
            final List<Token> messageBody = getMessageBody(tokens);
            final boolean hasVarData = -1 != findSignal(messageBody, Signal.BEGIN_VAR_DATA);

            int i = 0;
            final List<Token> fields = new ArrayList<>();
            i = collectFields(messageBody, i, fields);

            final List<Token> groups = new ArrayList<>();
            i = collectGroups(messageBody, i, groups);

            final List<Token> varData = new ArrayList<>();
            collectVarData(messageBody, i, varData);

            final String decoderClassName = formatClassName(decoderName(msgToken.name()));
            final String decoderStateClassName = decoderClassName + "#CodecStates";
            final FieldPrecedenceModel decoderPrecedenceModel = precedenceChecks.createDecoderModel(
                decoderStateClassName, tokens);
            generateDecoder(decoderClassName, msgToken, fields, groups, varData, hasVarData, decoderPrecedenceModel);

            final String encoderClassName = formatClassName(encoderName(msgToken.name()));
            final String encoderStateClassName = encoderClassName + "#CodecStates";
            final FieldPrecedenceModel encoderPrecedenceModel = precedenceChecks.createEncoderModel(
                encoderStateClassName, tokens);
            generateEncoder(encoderClassName, msgToken, fields, groups, varData, hasVarData, encoderPrecedenceModel);
        }
    }
@Test
    void shouldGenerateWithoutPrecedenceChecksByDefault() throws Exception
    {
        final PrecedenceChecks.Context context = new PrecedenceChecks.Context();
        final PrecedenceChecks precedenceChecks = PrecedenceChecks.newInstance(context);
        generator(precedenceChecks).generate();

        final Field field = Arrays.stream(compileCarEncoder().getDeclaredFields())
            .filter(f -> f.getName().equals(context.precedenceChecksFlagName()))
            .findFirst()
            .orElse(null);

        assertNull(field);
    }