anchor.diff:          if AvlTree.isEmpty stream then
               input
           else
  +            #if DEBUG
  +            /// The minimum possible number of elements in the resulting set.
  +            let minPossibleResultCount =
  +                let inputCount = count measurer input
  +                let streamCount = count measurer stream
  +
  +                if inputCount > streamCount then
  +                    inputCount - streamCount
  +                else 0
  +            #endif
  +
               let head, stream = AvlTree.extractMin measurer stream
               let result, _, _ = diff' input (Some head) stream
  +
  +            #if DEBUG
  +            let resultCount = count measurer result
  +            Debug.Assert (
  +                resultCount >= minPossibleResultCount,
  +                sprintf "The result set should not contain fewer than %i elements, but it contains only %i elements."
  +                    minPossibleResultCount resultCount)
  +            #endif
  +
               result
   
       /// Comparison function for DIETs.
  
positive.code:                         let (right, head, stream) = diff' right head stream
                          (AvlTree.join rangeAB left right, head, stream)
                      elif measurer.Compare (rangeAB.MinValue, rangeXY.MinValue) < 0 then
                          diff_helper (Range (rangeXY.MinValue, rangeAB.MaxValue)) right ((addRange measurer (Range (rangeAB.MinValue, measurer.Previous rangeXY.MinValue)) left)) head stream
                      elif measurer.Compare (rangeXY.MaxValue, rangeAB.MaxValue) < 0 then
                          let (head, stream) = AvlTree.tryExtractMin measurer stream
                          diff_helper (Range (measurer.Next rangeXY.MaxValue, rangeAB.MaxValue)) right left head stream
  
negative.code:             folder p state
  
          AvlTree.foldBack rangeFolder tree state
  
      /// Returns the number of intervals in the set.
      let intervalCount (t : Diet<'T>) =
  