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