If the original method is a stub, then the only way to figure out the number of arguments is to look at all of the stubs and take the max argument count. It doesn't feel like the cleanest solution, but there's really no other way to determine the number of arguments.