title: Java mechanisms at use in lambdaj closures
body: <p>Lamdbaj allows the definition of closures in the Java language, various examples can be found 
  <a href="http://code.google.com/p/lambdaj/wiki/Closures" rel="nofollow noreferrer">here</a></p>
  
  <p>My question is regarding the underlying Java mechanisms at use, for instance, to define the <code>println</code> closure, the following code is used:</p>
  
  <pre><code>Closure println = closure(); 
  { of(System.out).println(var(String.class)); }
  </code></pre>
  
  <p>This closure can be subsequently executed via:</p>
  
  <pre><code>println.apply("foobar");
  </code></pre>
  
  <p>I am curious as to what mechanisms in Java would allow the call to <code>of(...).println(...)</code> to become associated with the <code>println</code> instance itself. </p>
  
  <p>Naturally, the lambdaj source code is available to read but I was hoping for a slightly higher level explanation if anyone has one. My reflection skills go as far as a bit of introspection and executing methods dynamically.</p>