TextAndStreamBuilder extends OptionalExtraBuilder<TextAndStreamBuilder> implements AcceptsSingleExtraText<StreamBuilder>, AcceptsExtraStream<TextAndStreamBuilder>, Buildable { @NonNull @Override public TextAndStreamBuilder stream(@NonNull Uri stream) { builder.stream(stream); return this; } TextAndStreamBuilder(ShareIntentBuilder builder); @NonNull @Override TextAndStreamBuilder stream(@NonNull Uri stream); @NonNull @Override TextAndStreamBuilder stream(@NonNull Uri stream, @NonNull String type); @NonNull @Override StreamBuilder text(@NonNull String text); @NonNull @Override Intent build(); @Override void share(); @Override void share(@NonNull CharSequence title);  }
@Test public void streamShouldCallThroughToShareIntentBuilder() { TextAndStreamBuilder returnedBuilder = textAndStreamBuilder.stream(DEMO_STREAM); verify(builder).stream(DEMO_STREAM); assertThat(returnedBuilder).isSameAs(textAndStreamBuilder); }
@Test public void streamWithTypeShouldCallThroughToShareIntentBuilder() { TextAndStreamBuilder returnedBuilder = textAndStreamBuilder.stream(DEMO_STREAM, DEMO_TYPE); verify(builder).stream(DEMO_STREAM, DEMO_TYPE); assertThat(returnedBuilder).isSameAs(textAndStreamBuilder); }