def java_args(signature, params)
      return nil if params.nil?

      jtypes = []
      jargs = []
      params.each_with_index do |param, i|
        type = signature[i].get_type
        jtypes << type
        required_type = JavaClass.for_name(type)
        java_type = PRIMITIVE_JAVA_TYPES[required_type.name] || :object
        java_arg = param.to_java(java_type)

        if (param.kind_of? Array)
          java_arg = param.inject(ArrayList.new) {|l, element| l << element }
        end
        
        jargs << java_arg

        arg_type = java_arg.java_class
        
        raise TypeError.new("parameter #{signature[i].name} expected to be #{required_type}, but was #{arg_type}") if !required_type.assignable_from? arg_type
      end
      [jargs.to_java, jtypes.to_java(:string)]
    end
def java_args(signature, params)
      return nil if params.nil?

      jtypes = []
      jargs = []
      params.each_with_index do |param, i|
        type = signature[i].get_type
        jtypes << type
        required_type = JavaClass.for_name(type)
        java_type = PRIMITIVE_JAVA_TYPES[required_type.name] || :object
        java_arg = param.to_java(java_type)

        if (param.kind_of? Array)
          java_arg = param.inject(ArrayList.new) {|l, element| l << element }
        end
        
        jargs << java_arg

        arg_type = java_arg.java_class
        
        raise TypeError.new("parameter #{signature[i].name} expected to be #{required_type}, but was #{arg_type}") if !required_type.assignable_from? arg_type
      end
      [jargs.to_java, jtypes.to_java(:string)]
    end
Given the signature and the parameters supplied do these signatures match.
 Repackage these parameters as Java objects in a primitive object array.