@Test(timeout = 1000) public void testStacktraceLinesGetFirstLinesOverEstimatingTotalSizeOfLines() { int maxSizeOfFirstPart = 2500; StacktraceLines stackTraceLines = new StacktraceLines(lines); stackTraceLines.getFirstLines(maxSizeOfFirstPart); }
public List<String> getFirstLines(int firstSize) { int size = 0; int i = 0; while (size < firstSize && i < lines.size()) { size += lines.get(i).length(); i++; } return lines.subList(0, i - 1); }
StacktraceLines { public List<String> getFirstLines(int firstSize) { int size = 0; int i = 0; while (size < firstSize && i < lines.size()) { size += lines.get(i).length(); i++; } return lines.subList(0, i - 1); } }
StacktraceLines { public List<String> getFirstLines(int firstSize) { int size = 0; int i = 0; while (size < firstSize && i < lines.size()) { size += lines.get(i).length(); i++; } return lines.subList(0, i - 1); } StacktraceLines(List<String> lines); }
StacktraceLines { public List<String> getFirstLines(int firstSize) { int size = 0; int i = 0; while (size < firstSize && i < lines.size()) { size += lines.get(i).length(); i++; } return lines.subList(0, i - 1); } StacktraceLines(List<String> lines); List<String> getLines(); int getTotalLineLength(); List<String> getFirstLines(int firstSize); List<String> getLastLines(int lastSize); }
StacktraceLines { public List<String> getFirstLines(int firstSize) { int size = 0; int i = 0; while (size < firstSize && i < lines.size()) { size += lines.get(i).length(); i++; } return lines.subList(0, i - 1); } StacktraceLines(List<String> lines); List<String> getLines(); int getTotalLineLength(); List<String> getFirstLines(int firstSize); List<String> getLastLines(int lastSize);  }