public static Throwable getPrivateException(Object instance, String methodName, Object... parameters)
      throws ExecutionException {
    try {
      MethodUtils.invokeMethod(instance, true, methodName, parameters);
      return null;
    }
    catch (InvocationTargetException ex) {
      // Return the exception that was thrown.
      return ex.getCause();
    } catch (Exception ex) {
      throw new ExecutionException("Error invoking the method.", ex);
    }
  }
Call a private method by name using reflection and return the exception thrown.
@param instance The private method instance.
@param methodName Name of the private method to call.
@param parameters The parameters to pass to the method.
@return The exception thrown by the method.  Null if call did not throw exception.
@throws ExecutionException if failed to invoke the method.  The method is not expected to throw this exception.
ambry-test-utils/src/main/java/com/github/ambry/utils/TestUtils.java