title: Shorthand for "If/Throw, Else/Return" logic in Java 8?
body: <p>Is there a shorter syntax to if/throw else/return in Java 8? <code>java.util.Optional</code> provides a means to accomplish this in one statement, but it requires creating an <code>Optional</code> instance with every call that has a non-null reference. </p>
  
  <h2>Can this be accomplished in a single statement?</h2>
  
  <pre><code>public static MyEnum fromString(String value) {
      MyEnum result = enumMap.get(value);
      if (result == null)
          throw new IllegalArgumentException("Unsupported value: " + value);
      return result;
  }
  </code></pre>
  
  <h2>Optional Example (bad, requires Optional instance every time)</h2>
  
  <pre><code>public static MyEnum fromString(String value) {
      return Optional.ofNullable(enumMap.get(value)).orElseThrow(
          () -&gt; new IllegalArgumentException("Unsupported value: " + value));
  }
  </code></pre>