OptionalExtraBuilder { @NonNull public T cc(@NonNull String emailAddress) { builder.cc(emailAddress); return getSelf(); } OptionalExtraBuilder(ShareIntentBuilder builder); @NonNull T subject(@NonNull String subject); @NonNull T email(@NonNull String emailAddress); @NonNull T email(@NonNull Collection<String> emailAddresses); @NonNull T to(@NonNull String emailAddress); @NonNull T to(@NonNull Collection<String> emailAddresses); @NonNull T cc(@NonNull String emailAddress); @NonNull T cc(@NonNull Collection<String> emailAddresses); @NonNull T bcc(@NonNull String emailAddress); @NonNull T bcc(@NonNull Collection<String> emailAddresses);  }
@Test public void ccShouldCallThroughToShareIntentBuilder() { TestOptionalExtraBuilder returnedBuilder = optionalExtraBuilder.cc(DEMO_EMAIL_ADDRESS); verify(builder).cc(DEMO_EMAIL_ADDRESS); assertThat(returnedBuilder).isSameAs(optionalExtraBuilder); }
@Test public void ccWithCollectionShouldCallThroughToShareIntentBuilder() { TestOptionalExtraBuilder returnedBuilder = optionalExtraBuilder.cc(DEMO_EMAIL_ADDRESSES); verify(builder).cc(DEMO_EMAIL_ADDRESSES); assertThat(returnedBuilder).isSameAs(optionalExtraBuilder); }