public static Iterator<String> lineIterator(String input) {
    return new LineIterator(input);
  }
@Test
  public void lines() {
    assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\nbar\n")))
        .containsExactly("foo\n", "bar\n");
    assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\nbar")))
        .containsExactly("foo\n", "bar");

    assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\rbar\r")))
        .containsExactly("foo\r", "bar\r");
    assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\rbar")))
        .containsExactly("foo\r", "bar");

    assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\r\nbar\r\n")))
        .containsExactly("foo\r\n", "bar\r\n");
    assertThat(ImmutableList.copyOf(Newlines.lineIterator("foo\r\nbar")))
        .containsExactly("foo\r\n", "bar");
  }