code: @SuppressWarnings("unchecked")
    protected ResultQueueEntry<T> toResultQueueEntryForEquals(Object obj) {
      if (!(obj instanceof ResultQueueEntry) || obj == null) {
        return null;
      }
      ResultQueueEntry<T> other = (ResultQueueEntry<T>) obj;
      return type == other.type && getClass() == other.getClass() ? other : null;
    }
docs: This is a utility function for checking equality between this and another ResultQueueEntry.
  @param obj the object to compare to
  @return a reference to ResultQueueEntry if obj is: 1) not null, 2) a ResultQueueEntry, 3) has
  the same type as this.