title: Java Object as prototype in Rhino
body: <p>I am having difficulties using Java objects as JavaScript prototypes. This illustrates my problem:</p>
  
  <pre><code>var test = {};
  test.prototype = new java.util.ArrayList();
  test.prototype.add(1); // works
  test.add(1);           // fails
  </code></pre>
  
  <p>It seems to me that this should never happen: any function property accessible on the prototype must be accessible on the object itself.</p>
  
  <p>My goal is to add more function properties to the wrapped Java object. Is there at least a workaround to get the desired effect with Rhino? The constraint is that the adding of properties must be done on the JavaScript side.</p>
  
  <p>My Rhino is 1.7R4.</p>