code: public TimeOfDay withPeriodAdded(ReadablePeriod period, int scalar) {
          if (period == null || scalar == 0) {
              return this;
          }
          int[] newValues = getValues();
          for (int i = 0; i < period.size(); i++) {
              DurationFieldType fieldType = period.getFieldType(i);
              int index = indexOf(fieldType);
              if (index >= 0) {
                  newValues = getField(index).addWrapPartial(this, index, newValues,
                          FieldUtils.safeMultiply(period.getValue(i), scalar));
              }
          }
          return new TimeOfDay(this, newValues);
      }
docs: Returns a copy of this time with the specified period added,
  wrapping to what would be a new day if required.
  <p>
  If the addition is zero, then <code>this</code> is returned.
  Fields in the period that aren't present in the partial are ignored.
  <p>
  This method is typically used to add multiple copies of complex
  period instances. Adding one field is best achieved using methods
  like {@link #withFieldAdded(DurationFieldType, int)}
  or {@link #plusHours(int)}.
  
  @param period  the period to add to this one, null means zero
  @param scalar  the amount of times to add, such as -1 to subtract once
  @return a copy of this instance with the period added
  @throws ArithmeticException if the new datetime exceeds the capacity