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

require_relative '../../test_helper'

# when these tests are run under Ruby 1.8.7, they will use the
# self-defined Array#sample method in lib/extensions/array and will test whether it
# behaves as the 
    
  def test_returns_source_array_with_integer_param_equal_or_bigger_than_source_length
    source = %w[foo bar]
    result = source.sample(2)

    assert result.is_a? Array
    assert_predicate((source.sort <=> result.sort), :zero?)

    result = source.sample(3)

    assert result.is_a? Array
    assert_predicate((source.sort <=> result.sort), :zero?)
  end