### Question:
TextSegment { public String getText() { return text; } TextSegment(Iterable<Line> lines); String getText(); List<Line> getLines(); int offsetOf(int textOffset); int toTextOffset(int documentOffset); @Override String toString(); Line getLineAtOffset(int textOffset);  }### Answer:
@Test public void getText() { assertEquals("", new TextSegment(ImmutableList.<Line> of()).getText()); assertEquals("one\ntwo", new TextSegment(createLines("one\r\ntwo")).getText()); assertEquals("one\ntwo\nthree", new TextSegment(createLines("one\r\ntwo\nthree")).getText()); }