title: Return Consumer<T> with ?: operator
body: <p>I have a problem with write simply consumer function which operator <code>?:</code>
  I also don't know that it is possible to do what I want</p>
  
  <p>I can't change above syntax </p>
  
  <pre><code>public Consumer&lt;String&gt; restore(){
          return (s) -&gt; {
              if(s.equal("s")){
                  "something";
              }
              else {
                  "somwhere";
              }
          };
      }
  </code></pre>
  
  <p>to for example</p>
  
  <pre><code>public Consumer&lt;String&gt; restore(){
          return (s) -&gt;  s.equal("s") ? "something" : "somwhere";
      }
  </code></pre>
  
  <p>because I get error compiller</p>
  
  <blockquote>
    <p>java: incompatible types: bad return type in lambda expression
        target-type for conditional expression cannot be void</p>
  </blockquote>