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: collects_calls.rb
    path of file: ./repos/mocktail/lib/mocktail
    
    the code of the file until where you have to start completion: module Mocktail
  class CollectsCalls
    extend T::Sig

    def collect(double, method_name)
      calls = ExplainsThing.new.ex
    
    def collect(double, method_name)
      calls = ExplainsThing.new.explain(double).reference.calls

      if method_name.nil?
        calls
      else
        calls.select { |call| call.method.to_s == method_name.to_s }
      end