def sort(&comparator)
      comparator = Erlang.method(:compare) unless block_given?
      array = super(&comparator)
      array.map! { |k, v| next Erlang::Tuple[k, v] }
      return List.from_enum(array)
    end
def sort(&comparator)
      comparator = Erlang.method(:compare) unless block_given?
      array = super(&comparator)
      array.map! { |k, v| next Erlang::Tuple[k, v] }
      return List.from_enum(array)
    end
Return a sorted {List} which contains all the `[key, value]` pairs in
 this `Map` as two-element `Tuple`s.

 @overload sort
   Uses `#<=>` to determine sorted order.
 @overload sort { |(k1, v1), (k2, v2)| ... }
   Uses the block as a comparator to determine sorted order.

   @example
     m = Erlang::Map["Dog" => 1, "Elephant" => 2, "Lion" => 3]
     m.sort { |(k1, v1), (k2, v2)| k1.size  <=> k2.size }
     # => Erlang::List[Erlang::Tuple["Dog", 1], Erlang::Tuple["Lion", 3], Erlang::Tuple["Elephant", 2]]
   @yield [(k1, v1), (k2, v2)] Any number of times with different pairs of key/value associations.
   @yieldreturn [Integer] Negative if the first pair should be sorted
                          lower, positive if the latter pair, or 0 if equal.

 @see ::Enumerable#sort

 @return [List]