EmailIntent extends BaseIntent<EmailIntent> { @Override protected boolean onStartWith(@NonNull final IntentStarter starter, @NonNull final Intent intent) { return super.onStartWith(starter, Intent.createChooser(intent, dialogTitle)); }  EmailIntent to(@NonNull final String address); EmailIntent to(@NonNull final String... addresses); EmailIntent to(@Nullable final List<String> addresses); @NonNull List<String> addresses(); EmailIntent cc(@NonNull final String address); EmailIntent cc(@NonNull final String... addresses); EmailIntent cc(@Nullable final List<String> addresses); @NonNull List<String> ccAddresses(); EmailIntent bcc(@NonNull final String address); EmailIntent bcc(@NonNull final String... addresses); EmailIntent bcc(@Nullable final List<String> addresses); @NonNull List<String> bccAddresses(); EmailIntent subject(@NonNull final CharSequence subject); @NonNull CharSequence subject(); EmailIntent message(@NonNull final CharSequence message); @NonNull CharSequence message(); @Nullable static Uri createUri(@NonNull final List<String> addresses); static final String URI_SCHEME; static final Matcher EMAIL_MATCHER; }
@Test public void testOnStartWith() { final EmailIntent emailIntent = new EmailIntent(); emailIntent.to("test1@android.com"); final Intent intent = emailIntent.build(context); final IntentStarter mockIntentStarter = mock(IntentStarter.class); emailIntent.onStartWith(mockIntentStarter, intent); verify(mockIntentStarter).startIntent(any(Intent.class)); }