code: void register(long mjDay, int leapAdjustment) {
          if (leapAdjustment != -1 && leapAdjustment != 1) {
              throw new IllegalArgumentException("Leap adjustment must be -1 or 1");
          }
          Data data = dataRef.get();
          int pos = Arrays.binarySearch(data.dates, mjDay);
          int currentAdj = pos > 0 ? data.offsets[pos] - data.offsets[pos - 1] : 0;
          if (currentAdj == leapAdjustment) {
              return;  // matches previous definition
          }
          if (mjDay <= data.dates[data.dates.length - 1]) {
              throw new IllegalArgumentException("Date must be after the last configured leap second date");
          }
          long[] dates = Arrays.copyOf(data.dates, data.dates.length + 1);
          int[] offsets = Arrays.copyOf(data.offsets, data.offsets.length + 1);
          long[] taiSeconds = Arrays.copyOf(data.taiSeconds, data.taiSeconds.length + 1);
          int offset = offsets[offsets.length - 2] + leapAdjustment;
          dates[dates.length - 1] = mjDay;
          offsets[offsets.length - 1] = offset;
          taiSeconds[taiSeconds.length - 1] = tai(mjDay, offset);
          Data newData = new Data(dates, offsets, taiSeconds);
          if (dataRef.compareAndSet(data, newData) == false) {
              throw new ConcurrentModificationException("Unable to update leap second rules as they have already been updated");
          }
      }
docs: Adds a new leap second to these rules.
  
  @param mjDay  the Modified Julian Day that the leap second occurs at the end of
  @param leapAdjustment  the leap seconds to add/remove at the end of the day, either -1 or 1
  @throws IllegalArgumentException if the leap adjustment is invalid
  @throws IllegalArgumentException if the day is before or equal the last known leap second day
  and the definition does not match a previously registered leap
  @throws ConcurrentModificationException if another thread updates the rules at the same time