// The PmtPeriod for the ExtraPmt must be equal to the payment period for the mortgage,
// or YEARLY if the mortage payment is monthly, YEARLY_FOR_WEEKLY if the mortgage payment is WEEKLY or
// RAPID_WEEKLY, YEARLY_FOR_BIWEEKLY if the mortgage payment is BIWEEKLY or RAPID_BIWEEKLY, or ONETIME. Anything
// else is invalid.
PmtPeriod mortgagePeriod = pmtKey.getPmtPeriod();
PmtPeriod extraPeriod = extraPmts.getPmtKey().getPmtPeriod();
boolean validPeriod = isValidPmtPeriod(mortgagePeriod, extraPeriod);
Preconditions.checkArgument(validPeriod, "Extra Payment Period " + extraPeriod
+ " is invalid for a mortgage payment period of " + mortgagePeriod + ".");
for (LocalDate key : extraPmts.getPmtKey().getKeys()) {