(defn to-array-2d
"Returns a (potentially-ragged) 2-dimensional array of Objects
containing the contents of coll, which can be any Collection of any
Collection."
{:tag "[[Ljava.lang.Object;"
:added "1.0"
:static true}
[^java.util.Collection coll]
(let [ret (make-array (. Class (forName "[Ljava.lang.Object;")) (. coll (size)))]
(loop [i 0 xs (seq coll)]
(when xs
(aset ret i (to-array (first xs)))
(recur (inc i) (next xs))))
ret))