code: HistoricEra getPreferredEra(
          HistoricDate hd,
          PlainDate date
      ) {
  
          if ((this.era == null) || date.isBefore(this.start) || date.isAfter(this.end)) {
              return ((hd.compareTo(AD1) < 0) ? HistoricEra.BC : HistoricEra.AD);
          } else if ((this.era == HistoricEra.HISPANIC) && (hd.compareTo(BC38) < 0)) {
              return HistoricEra.BC; // exceptional case
          } else {
              return this.era;
          }
  
      }
docs: determines the preferred era for a given historic date