@Override
    public boolean equals(Object obj) {
      if (this == obj) return true;
      if (obj == null) return false;
      if (getClass() != obj.getClass()) return false;
      QuerySpec other = (QuerySpec) obj;
      if (end != other.end
          || queryStartMillis != other.queryStartMillis
          || queryType != other.queryType
          || start != other.start
          || Utils.equals(searchQuery, other.searchQuery)
          || id != other.id) {
        return false;
      }

      if (goToTime != null) {
        if (goToTime.toMillis(false) != other.goToTime.toMillis(false)) {
          return false;
        }
      } else {
        if (other.goToTime != null) {
          return false;
        }
      }
      return true;
    }