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: collection.rb
    path of file: ./repos/leftovers/lib/leftovers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require 'set'

module Leftovers
  class Collection
    attr_reader :calls, :test_calls, :definitions

    def initialize
      @calls = []
      @test_calls = []
      @definitions = []
    end

    def leftovers
      @leftovers ||= begin
        freeze_calls
    
    def split_leftovers
      return @split_leftovers if defined?(@split_leftovers)

      @split_leftovers = leftovers.partition do |definition|
        !definition.test? && definition.in_test_collection?(self)
      end.each(&:freeze).freeze

      freeze

      @split_leftovers
    end

    def freeze_calls
      @calls = @calls.to_set.compare_by_identity.freeze
      @test_calls = @test_calls.to_set.compare_by_identity.freeze
    end
  end