Reflection does not return the same order of methods across JVM invocations (via Class::getMethods). This is probably most apparent when submitting Clojure functions, which are Callable and Runnable, into an executor:
(ns repro)
;;(set! *warn-on-reflection* true)
(defn repro
[]
(let [exec (java.util.concurrent.ForkJoinPool/commonPool)
work #(do 1)]
(deref (.submit ^Object exec work)))) ;; intentionally reflect
(defn -main []
;; dereffing a runnable returns nil, a callable can return a value, in this case an integer
(System/exit (or (repro) 0)))
nondeterministic ➜ while true; do clojure -m repro; echo $?; done
0
0
0
1
0
0
0
1
0
0
0