StacktraceLines { public int getTotalLineLength() { int length = 0; for (String line: lines) { length += line.length(); } return length; } StacktraceLines(List<String> lines); List<String> getLines(); int getTotalLineLength(); List<String> getFirstLines(int firstSize); List<String> getLastLines(int lastSize);  }
@Test public void testStacktraceLinesGetTotalLineLength() { StacktraceLines lineWriter = new StacktraceLines(lines); assertThat(lineWriter.getTotalLineLength(), equalTo(67)); }
@Test public void testStacktraceLinesGetTotalLineLengthOnEmptyLines() { ArrayList<String> emptyLines = new ArrayList<String>(); StacktraceLines lineWriter = new StacktraceLines(emptyLines); assertThat(lineWriter.getTotalLineLength(), equalTo(0)); }