public static Intent findIntentByComponentClass(Collection<Intent> intents, Class<?> cls) {
    for (Intent intent : intents) {
      ComponentName componentName = intent.getComponent();
      if ((componentName != null) && (cls.getName().equals(componentName.getClassName()))) {
        return intent;
      }
    }
    return null;
  }
Finds an {@link Intent} whose component name points to the specified class.

@return first matching {@code Intent} or {@code null} if no match found.
javatests/com/google/android/apps/authenticator/testing/TestUtilities.java