@Override
          public Void call() throws Exception {
            // The method has to be invoked via Reflection because it's protected rather than
            // public.
            Method method =
                Activity.class.getDeclaredMethod(
                    "onActivityResult", int.class, int.class, Intent.class);
            method.setAccessible(true);
            method.invoke(activity, requestCode, resultCode, intent);
            return null;
          }
Invokes the {@link Activity}'s {@code onActivityResult} on the UI thread and blocks (with a
timeout) the calling thread until the invocation completes. If the calling thread is the UI
thread, the {@code finish} is invoked directly and without a timeout.
javatests/com/google/android/apps/authenticator/testing/TestUtilities.java