// -------- PRIVATE SUBROUTINES --------
private LocalDate determineTargetExpiry(LocalDate referenceDate, int monthsFromReferenceDate) {
LocalDate result = referenceDate.plusMonths(monthsFromReferenceDate);
result = LocalDate.of(result.getYear(), result.getMonth(), 1);
while (!(result.getDayOfWeek() == FRIDAY)) {
result = result.plusDays(1);
}
result = result.plusDays(15); // Saturday after third Friday
// Fencepost condition: if we are looking 0 months ahead, but the referenceDate is past the
// the Saturday after third Friday, then move forward 1 month