You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: skip_after_collapse_spec.rb
    path of file: ./repos/karafka/spec/integrations/pro/consumption/strategies/dlq/vp
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# DLQ in the VP mode should collapse and skip when error occurs again in a collapsed mode
# After that, we should move to processing in a non-collap
    
  def consume
    messages.each do |message|
      # Simulates a broken message that for example one that cannot be deserialized
      raise StandardError if message.offset == 5

      # Mark only in a collapsed mode
      mark_as_consumed(message) if collapsed?

      DT[:flow] << [message.offset, object_id, collapsed?]
    end
  end