EmailIntentBuilder { @NotNull static String fixLineBreaks(String text) { return text.replaceAll("\r\n", "\n").replace('\r', '\n').replaceAll("\n", "\r\n"); } private  EmailIntentBuilder(@NotNull Context context); @NotNull static EmailIntentBuilder from(@NotNull Context context); @NotNull EmailIntentBuilder to(@NotNull String to); @NotNull EmailIntentBuilder to(@NotNull Collection<String> to); @NotNull EmailIntentBuilder cc(@NotNull String cc); @NotNull EmailIntentBuilder cc(@NotNull Collection<String> cc); @NotNull EmailIntentBuilder bcc(@NotNull String bcc); @NotNull EmailIntentBuilder bcc(@NotNull Collection<String> bcc); @NotNull EmailIntentBuilder subject(@NotNull String subject); @NotNull EmailIntentBuilder body(@NotNull String body); boolean start(); @NotNull Intent build();  }
@Test public void fixLineBreaks_withArgumentContainingCr_shouldReturnExpectedResult() { String result = EmailIntentBuilder.fixLineBreaks("\r2nd"); assertThat(result).isEqualTo("\r\n2nd"); }
@Test public void fixLineBreaks_withArgumentContainingLf_shouldReturnExpectedResult() { String result = EmailIntentBuilder.fixLineBreaks("hi\nthere"); assertThat(result).isEqualTo("hi\r\nthere"); }
@Test public void fixLineBreaks_withArgumentContainingCrLf_shouldReturnExpectedResult() { String result = EmailIntentBuilder.fixLineBreaks("line one\r\nline two"); assertThat(result).isEqualTo("line one\r\nline two"); }