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: synthetics_sample_buffer_test.rb
    path of file: ./repos/newrelic-ruby-agent/test/new_relic/agent/transaction
    
    the code of the file until where you have to start completion: # This file is distributed u
    
    def test_applies_limits
      last_sample = nil

      try_count = @buffer.capacity + 1
      try_count.times do |i|
        last_sample = stub(:synthetics_resource_id => i)
        @buffer.store(last_sample)
      end

      assert_equal @buffer.capacity, @buffer.samples.length
      refute_includes @buffer.samples, last_sample
    end