 (extend-type LocalTime
   ITimeArithmetic
   (+ [t x] (.plus t x))
-  (- [t x] (.minus t x))
-  (maximum [x y] (if (neg? (compare x y)) y x))
-  (minimum [x y] (if (neg? (compare x y)) x y))
-  )
+  (- [t x] (.minus t x)))
 
 (extend-type YearMonth
   ITimeArithmetic
   (+ [t x] (.plus t x))
   (- [t x] (.minus t x))
+
+  ITimeIncDec
   (inc [t] (.plusMonths t 1))
   (dec [t] (.minusMonths t 1))
-  (maximum [x y] (if (neg? (compare x y)) y x))
-  (minimum [x y] (if (neg? (compare x y)) x y))
+
   ITimeRangeable
   (range
     ([from] (iterate #(.plusMonths % 1) from))

  (<= [x y] (not (.isAfter x y)))
  (> [x y] (.isAfter x y))
  (>= [x y] (not (.isBefore x y)))
  LocalDateTime
  (< [x y] (.isBefore x y))
  (<= [x y] (not (.isAfter x y)))
  (> [x y] (.isAfter x y))
  (>= [x y] (not (.isBefore x y)))
  LocalTime
  (< [x y] (.isBefore x y))
  (<= [x y] (not (.isAfter x y)))
  (> [x y] (.isAfter x y))
  (>= [x y] (not (.isBefore x y)))
  OffsetDateTime
  (< [x y] (.isBefore x y))
  (<= [x y] (not (.isAfter x y)))
  (> [x y] (.isAfter x y))
  (>= [x y] (not (.isBefore x y)))
  ZonedDateTime
  (< [x y] (.isBefore x y))
  (<= [x y] (not (.isAfter x y)))
  (> [x y] (.isAfter x y))
  (>= [x y] (not (.isBefore x y))))

(defprotocol ITimeRangeable
  (range [_] [_ _] [_ _ _] "Returns a lazy seq of times from start (inclusive) to end (exclusive, nil means forever), by step, where start defaults to 0, step to 1, and end to infinity."))


(defprotocol ITimeArithmetic
  (+ [_ _] "Add time")
  (- [_ _] "Subtract time"))

(defprotocol ITimeIncDec
  (inc [_] "Increment time")
  (dec [_] "Decrement time"))

(defn max [arg & args]
  (reduce #(maximum %1 %2) arg args))
