@Override
  public ZoneOffsetTransition nextTransition(Instant instant) {

    long epochSec = instant.getEpochSecond();

    // check if using last rules
    if (epochSec >= this.savingsInstantTransitions[this.savingsInstantTransitions.length - 1]) {
      if (this.lastRules.length == 0) {
        return null;
      }
      // search year the instant is in
      int year = findYear(epochSec, this.wallOffsets[this.wallOffsets.length - 1]);
      ZoneOffsetTransition[] transArray = findTransitionArray(year);
      for (ZoneOffsetTransition trans : transArray) {
        if (epochSec < trans.toEpochSecond()) {
          return trans;
        }
      }
      // use first from following year
      if (year < LocalDate.MAX_YEAR) {
        transArray = findTransitionArray(year + 1);
        return transArray[0];
      }
      return null;
    }

    // using historic rules
    int index = Arrays.binarySearch(this.savingsInstantTransitions, epochSec);
    if (index < 0) {
      index = -index - 1; // switched value is the next transition
    } else {
      index += 1; // exact match, so need to add one to get the next
    }
    return new ZoneOffsetTransition(this.savingsInstantTransitions[index], this.wallOffsets[index],
        this.wallOffsets[index + 1]);
  }