TextAndStreamNoBuilder extends OptionalExtraBuilder<TextAndStreamNoBuilder> implements AcceptsSingleExtraText<StreamBuilder>, AcceptsExtraStream<TextAndStreamBuilder> { @NonNull @Override public StreamBuilder text(@NonNull String text) { builder.text(text); return new StreamBuilder(builder); } TextAndStreamNoBuilder(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);  }
@Test public void textShouldCreateStreamBuilder() { StreamBuilder returnedBuilder = textAndStreamNoBuilder.text(DEMO_TEXT); verify(builder).text(DEMO_TEXT); assertThat(returnedBuilder.builder).isSameAs(builder); }