title: Is it possible to implement a general try catch method in java using lambda expressions?
body: <p>I've been trying to create a general trycatch method like this:</p>
  
  <pre><code>public static void tryCatchAndLog(Runnable tryThis) {
      try {
          tryThis.run();
      } catch (Throwable throwable) {
          Log.Write(throwable);
      }
  }
  </code></pre>
  
  <p>However I get an unhandled exception if I try to use it like this:</p>
  
  <pre><code>tryCatchAndLog(() -&gt; {
      methodThatThrowsException();
  });
  </code></pre>
  
  <p>How can I implement this so that the compiler knows that tryCatchAndLog will handle the Exception?</p>