/** * Calculates the range of months based on the temporal. * * @param temporal the temporal, not null * @return the month range, negative if not fixed range */ private long monthRange(Temporal temporal) { ValueRange startRange = Chronology.from(temporal).range(MONTH_OF_YEAR); if (startRange.isFixed() && startRange.isIntValue()) { return startRange.getMaximum() - startRange.getMinimum() + 1; } return -1; }