code: @Override
      public boolean hasSameRules(TimeZone other) {
          if (this == other) {
              return true;
          }
  
          if (!(other instanceof RuleBasedTimeZone)) {
              // We cannot reasonably compare rules in different types
              return false;
          }
          RuleBasedTimeZone otherRBTZ = (RuleBasedTimeZone)other;
  
          // initial rule
          if (!initialRule.isEquivalentTo(otherRBTZ.initialRule)) {
              return false;
          }
  
          // final rules
          if (finalRules != null && otherRBTZ.finalRules != null) {
              for (int i = 0; i < finalRules.length; i++) {
                  if (finalRules[i] == null && otherRBTZ.finalRules[i] == null) {
                      continue;
                  }
                  if (finalRules[i] != null && otherRBTZ.finalRules[i] != null
                          && finalRules[i].isEquivalentTo(otherRBTZ.finalRules[i])) {
                      continue;
                      
                  }
                  return false;
              }
          } else if (finalRules != null || otherRBTZ.finalRules != null) {
              return false;
          }
  
          // historic rules
          if (historicRules != null && otherRBTZ.historicRules != null) {
              if (historicRules.size() != otherRBTZ.historicRules.size()) {
                  return false;
              }
              for (TimeZoneRule rule : historicRules) {
                  boolean foundSameRule = false;
                  for (TimeZoneRule orule : otherRBTZ.historicRules) {
                      if (rule.isEquivalentTo(orule)) {
                          foundSameRule = true;
                          break;
                      }
                  }
                  if (!foundSameRule) {
                      return false;
                  }
              }
          } else if (historicRules != null || otherRBTZ.historicRules != null) {
              return false;
          }
          return true;
      }
docs: {@inheritDoc}