title: Is there an Immediately Invoked Anonymous Function for Java?
body: <p>For example, I might want to do an assignment like this (in JavaScript):</p>
  
  <pre><code>var x = (function () {
      // do some searching/calculating
      return 12345;
  })();
  </code></pre>
  
  <p>And in Java, how can I do something similar with Lambdas? The compiler does not
  like something like this:</p>
  
  <pre><code>Item similarItem = () -&gt; {
      for (Item i : POSSIBLE_ITEMS) {
          if (i.name.equals(this.name)) return i;
      }
      return null;
  }();
  </code></pre>