title: Exception when using ?: operator in Java 8 lambda expression
body: <p>Why is an exception thrown when using <code>?:</code> operator in a Java 8 lambda expression?<br>
  When I try to run the following sample code:</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  
  public class TestClass
  {
      public static void main(String[] args)
      {
          List&lt;Foo&gt; foos = new ArrayList&lt;&gt;();
          boolean b = true;
          foos.forEach(foo -&gt; (b ? foo.doSth(1) : foo.doSth(2)));
      }
  
      @FunctionalInterface
      interface Foo
      {
          public void doSth(int i);
      }
  }
  </code></pre>
  
  <p>I get the following exception:</p>
  
  <pre><code>Exception in thread "main" java.lang.Error: Unresolved compilation problem: 
  at gui.marksDetection.view.TestClass.main(TestClass.java:8)
  </code></pre>
  
  <p>When replacing the lambda expression with a for-each-loop, or replacing <code>(b ? foo.doSth(1) : foo.doSth(2))</code> with an if-else-block, everything works fine, so there seems to be a problem with the combination <code>?: + lambda</code>. However, Eclipse does not mark it as an error.</p>