   @check_for_duplicate_expectations: ->
     # TODO: use each with index and slice to avoid last element
     return if _expectations.length < 2
-    for outer in [0.._expectations.length-2]
-      for inner in [outer+1.._expectations.length-1]
+    for outer in [0.._expectations.length-2]                     # given [ a, b, c ]
+      for inner in [outer+1.._expectations.length-1]             # these loops produce the pairs (a,b), (a,c), (b,c)
         if _expectations[outer].equals( _expectations[inner] )
           _throw_duplicate_expectation("#{_expectations[outer]._method_name}(#{_expectations[outer]._args})")
 

  @register_expectation: (expectation) ->
    _expectations.push(expectation)
    
  @find_expectation: (object, method_name, args...) ->
    for expectation in _expectations when expectation.matches(object, method_name, args...)
      return expectation
    undefined

  # private

  _build_convenience_mock_objects = ->
    ( new Object() for i in [1..5] )        # => [ object, object, ... ]

  _run_test_function = (test_function, convenience_mocks) ->
    test_function.apply(undefined, convenience_mocks)
