code: private LocalDate calculateIMMMonth(final boolean requestNextIMM, final LocalDate startDate, final int month) {
          int monthOffset;
          LocalDate date = startDate;
          switch (month) {
          case MARCH:
          case JUNE:
          case SEPTEMBER:
          case DECEMBER:
              final LocalDate immDate = calculate3rdWednesday(date);
              if (requestNextIMM && !date.isBefore(immDate)) {
                  date = date.plusMonths(MONTHS_IN_QUARTER);
              } else if (!requestNextIMM && !date.isAfter(immDate)) {
                  date = date.minusMonths(MONTHS_IN_QUARTER);
              }
              break;
  
          default:
              if (requestNextIMM) {
                  monthOffset = (MONTH_IN_YEAR - month) % MONTHS_IN_QUARTER;
                  date = date.plusMonths(monthOffset);
              } else {
                  monthOffset = month % MONTHS_IN_QUARTER;
                  date = date.minusMonths(monthOffset);
              }
              break;
          }
          return date;
      }
docs: -----------------------------------------------------------------------