   width."
   ([^CharSequence s ^long width]
    (pad-right s width " "))
-  ([^CharSequence s ^Long width ^CharSequence padding]
+  ([^CharSequence s ^long width ^CharSequence padding]
    {:pre [(not-empty padding)
           (not (nil? s))]
     :post [(= (.length %) width)]}

(defn ^String center
  "Pad both ends of s with padding, or spaces, until the length of s
  matches width."
  ([^CharSequence s ^Long width]
   (center s width " "))
  ([^CharSequence s ^Long width ^CharSequence padding]
   {:pre [(not-empty padding)
          (not (nil? s))]
    :post [(= (.length %) width)]}


(defn- gen-padding
  "Generate the necessary padding to fill s upto width."
  [^CharSequence s ^CharSequence padding ^long width]
  (let [missing (- width (.length s))
        full-lengths (Math/floor (/ missing (.length padding)))
        remaining (if (zero? full-lengths) (- width (.length s))
