old_contents: from typing import Any, Generic, Optional, TypeVar, Union, cast
  
  from rx.core import Notification, typing
  from rx.internal.basic import default_comparer
  from rx.testing.reactivetest import OnErrorPredicate, OnNextPredicate
  
  _T = TypeVar("_T")
  
  
  class Recorded(Generic[_T]):
      def __init__(
          self,
          time: int,
          value: Union[Notification[_T], OnNextPredicate[_T], OnErrorPredicate[_T]],
          comparer: Optional[typing.Comparer[_T]] = None,
      ):
          self.time = time
          self.value = value
          self.comparer = comparer or default_comparer
  
      def __eq__(self, other: Any) -> bool:
          """Returns true if a recorded value matches another recorded value"""
  
          if isinstance(other, Recorded):
              time_match = self.time == other.time
              return time_match and self.comparer(
                  self.value, cast(Recorded[_T], other).value
              )
  
          return False
  
      equals = __eq__
  
      def __repr__(self) -> str:
          return str(self)
  
      def __str__(self) -> str:
          return "%s@%s" % (self.value, self.time)
  
new_contents: from typing import TYPE_CHECKING, Any, Generic, Optional, TypeVar, Union, cast
  
  from rx.core import Notification, typing
  from rx.internal.basic import default_comparer
  
  if TYPE_CHECKING:
      from rx.testing.reactivetest import OnErrorPredicate, OnNextPredicate
  
  
  _T = TypeVar("_T")
  
  
  class Recorded(Generic[_T]):
      def __init__(
          self,
          time: int,
          value: Union[Notification[_T], "OnNextPredicate[_T]", "OnErrorPredicate[_T]"],
          comparer: Optional[typing.Comparer[_T]] = None,
      ):
          self.time = time
          self.value = value
          self.comparer = comparer or default_comparer
  
      def __eq__(self, other: Any) -> bool:
          """Returns true if a recorded value matches another recorded value"""
  
          if isinstance(other, Recorded):
              time_match = self.time == other.time
              return time_match and self.comparer(
                  self.value, cast(Recorded[_T], other).value
              )
  
          return False
  
      equals = __eq__
  
      def __repr__(self) -> str:
          return str(self)
  
      def __str__(self) -> str:
          return "%s@%s" % (self.value, self.time)
  
subject: Remove circular import