public static void forEachField(final List<Token> tokens, final BiConsumer<Token, Token> consumer)
    {
        for (int i = 0, size = tokens.size(); i < size;)
        {
            final Token fieldToken = tokens.get(i);
            if (fieldToken.signal() == Signal.BEGIN_FIELD)
            {
                final Token typeToken = tokens.get(i + 1);
                consumer.accept(fieldToken, typeToken);
                i += fieldToken.componentTokenCount();
            }
            else
            {
                ++i;
            }
        }
    }
For each field found in a list of field {@link Token}s take the field token and following type token to
a {@link BiConsumer}.

@param tokens   to be iterated over.
@param consumer to for the field and encoding token pair.
sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/Generators.java