validateLine(line, expected.substring(0, pos), result.substring(0, pos)); expected = expected.substring(pos + 1); result = result.substring(pos + 1);
    private void validateLines(String expected, String result) {        int  line = 1;        int  pos;        pos = result.indexOf('\n');        while (pos > 0) {            if (expected.length() < pos) {                break;            }            validateLine(line,                         expected.substring(0, pos),                          result.substring(0, pos));            expected = expected.substring(pos + 1);            result = result.substring(pos + 1);            pos = result.indexOf('\n');            line++;        }        validateLine(line, expected, result);    }