public static PendingIntent createFakePendingIntent() {
    try {
      Constructor<PendingIntent> constructor =
          PendingIntent.class.getDeclaredConstructor(IBinder.class);
      constructor.setAccessible(true);
      return constructor.newInstance(mock(IBinder.class));
    } catch (IllegalArgumentException e) {
      throw e;
    } catch (InstantiationException e) {
      throw new RuntimeException(e);
    } catch (IllegalAccessException e) {
      throw new RuntimeException(e);
    } catch (InvocationTargetException e) {
      throw new RuntimeException(e);
    } catch (NoSuchMethodException e) {
      throw new RuntimeException(e);
    }
  }
Creates a fake PendingIntent that can be used as a test value
javatests/com/google/android/apps/authenticator/testing/TestUtilities.java