ContentIntent extends BaseIntent<I> { @Override protected boolean onStartWith(@NonNull final IntentStarter starter, @NonNull final Intent intent) { return super.onStartWith(starter, Intent.createChooser(intent, dialogTitle)); }  @NonNull static String createContentFileTimeStamp(); @Nullable static File createContentFile(@NonNull final String fileName, @NonNull final String externalDirectoryType); @Nullable static File createContentFile(@NonNull final String fileName, @NonNull final File directory); abstract ContentIntent withDefaultHandlers(@NonNull Context context); I withHandlers(@NonNull final ContentHandler... handlers); @SuppressWarnings("unchecked") I withHandlers(@Nullable final List<ContentHandler> handlers); @SuppressWarnings("unchecked") I withHandler(@NonNull final ContentHandler handler); @SuppressWarnings("unchecked") @NonNull List<ContentHandler> handlers(); @SuppressWarnings("unchecked") I input(@Nullable final File file); @SuppressWarnings("unchecked") I input(@Nullable final Uri uri); @SuppressWarnings("unchecked") I output(@Nullable final File file); @SuppressWarnings("unchecked") I output(@Nullable final Uri uri); @Nullable Uri uri(); @SuppressWarnings("unchecked") I dataType(@NonNull @MimeType.Value final String type); @Nullable @MimeType.Value String dataType(); @Override boolean startWith(@NonNull final IntentStarter starter); @Override @NonNull Intent build(@NonNull final Context context); static final String CONTENT_FILE_TIME_STAMP_FORMAT; }
@Test public void testOnStartWith() { final ContentIntent contentIntent = new ContentIntentImpl(); contentIntent.input(Uri.EMPTY); contentIntent.dataType(MimeType.TEXT_HTML); final Intent intent = contentIntent.build(context); final IntentStarter mockStarter = mock(IntentStarter.class); contentIntent.onStartWith(mockStarter, intent); verify(mockStarter).startIntent(any(Intent.class)); }