code: public static function frequency(Iterator $iterator, $element) : int
      {
          $frequency = 0;
          Iterators::each($iterator, function ($item) use (&$frequency, $element) {
              if (Objects::equal($element, $item)) {
                  $frequency++;
              }
          });
          return $frequency;
      }
docs: Returns the number of elements in the specified iterator that equal the specified object.
  The check based on {@link Objects::equal()}.
  
  @param Iterator $iterator
  @param $element
  @return int