Without knowing exactly how this is used, I don't think this will work since a Clojure function can have a single arity, multiple fixed-arities, or varargs. It's also a little arbitrary since it picks the number of params to whatever the first declared method of the class is. For `+`, which really can have any arity, that happens to be 2:

```
user=> (->> + class .getDeclaredMethods seq)
(#<Method public java.lang.Object clojure.core$_PLUS_.invoke(java.lang.Object,java.lang.Object)>
 #<Method public java.lang.Object clojure.core$_PLUS_.invoke(java.lang.Object)>
 #<Method public java.lang.Object clojure.core$_PLUS_.invoke()>
 #<Method public int clojure.core$_PLUS_.getRequiredArity()>
 #<Method public java.lang.Object clojure.core$_PLUS_.doInvoke(java.lang.Object,java.lang.Object,java.lang.Object)>)
```

In the case of variable-arity functions, an extra method, `getRequiredArity()` is inserted which causes this to always return 0:

```
user=> (defn varargs [x & args])
#'user/varargs
user=> (->> varargs class .getDeclaredMethods seq)
(#<Method public int user$varargs.getRequiredArity()>
 #<Method public java.lang.Object user$varargs.doInvoke(java.lang.Object,java.lang.Object)>)
```

:(