public static Exception getException(Utils.RunnableThatThrow<Exception> function) {
    try {
      function.run();
      return null;
    } catch (Exception ex) {
      return ex;
    }
  }
Invoke a lambda function that throws 1 checked exception.
If a lambda function throws a checked exception, the is required to put try-catch around the lambda function to
cast away the throw, which makes the code ugly and bigger.  An alternative is to use this approach that supports
lambda function that throws one checked exception, but it requires pass the class of the checked exception, due
to the way Java handles generic at compile-time.

Return the exception thrown by the function.
Returns null if no exception is thrown.
@param function The lambda function to run.
@return The exception thrown by the function.
ambry-test-utils/src/main/java/com/github/ambry/utils/TestUtils.java