title: Convert instance of class org.jruby.RubyArray to class java.util.ArrayList
body: <p>I'm new to Ruby &amp; Jruby . I want to test some stuffs of jruby in java code </p>
  
  <p>Here is my code :</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.HashMap;
  import org.jruby.embed.LocalVariableBehavior;
  import org.jruby.embed.ScriptingContainer;
  
  public class Test {
      public static void main(String[] args){
          ScriptingContainer container = new ScriptingContainer(LocalVariableBehavior.PERSISTENT);
          Test t = new Test();
          LogStatBean bean = t.new LogStatBean();
          container.setHomeDirectory("classpath:/META-INF/jruby.home");
          container.put("bean", bean);
          container.runScriptlet("arr = [1, 2, 3, 4, 5, 6]");
          container.runScriptlet("puts arr");
          container.runScriptlet("bean.setOutput(arr) ");
          System.out.println(bean.getOutput());
  
      }
      public class LogStatBean {
          public ArrayList&lt;HashMap&lt;String, Object&gt;&gt; getOutput() {
              return output;
          }
          public void setOutput(ArrayList&lt;HashMap&lt;String, Object&gt;&gt; output) {
              this.output = output;
          }
          public ArrayList&lt;HashMap&lt;String, Object&gt;&gt; output;
  
      }
  }
  </code></pre>
  
  <p>I cannot set the java local variable with type ArrayList in jruby ,it raise an error</p>
  
  <pre><code>TypeError: cannot convert instance of class org.jruby.RubyArray to class java.util.ArrayList
    (root) at &lt;script&gt;:1
  </code></pre>
  
  <p>What i have to do ?</p>