### Question:
BufferedReader extends Reader { public String readLine() { verifyNotClosed(); if (pos == end && fillBuf() == -1) return null; for (int charPos = pos; charPos < end; charPos++) { char ch = buf[charPos]; if (ch > '\r') { continue; } if (ch == '\n') { String res = new String(buf, pos, charPos - pos); pos = charPos + 1; return res; } else if (ch == '\r') { String res = new String(buf, pos, charPos - pos); pos = charPos + 1; if (((pos < end) || (fillBuf() != -1)) && (buf[pos] == '\n')) { pos++; } return res; } } char eol = '\0'; StringBuilder result = new StringBuilder(80); result.append(buf, pos, end - pos); while (true) { pos = end; if (eol == '\n') { return result.toString(); } if (fillBuf() == -1) { return result.length() > 0 || eol != '\0' ? result.toString() : null; } for (int charPos = pos; charPos < end; charPos++) { char c = buf[charPos]; if (eol == '\0') { if ((c == '\n' || c == '\r')) { eol = c; } } else if (eol == '\r' && c == '\n') { if (charPos > pos) { result.append(buf, pos, charPos - pos - 1); } pos = charPos + 1; return result.toString(); } else { if (charPos > pos) { result.append(buf, pos, charPos - pos - 1); } pos = charPos; return result.toString(); } } if (eol == '\0') result.append(buf, pos, end - pos); else result.append(buf, pos, end - pos - 1); } } BufferedReader(Reader reader);  BufferedReader(Reader reader, int size); @Override void close(); void mark(int markLimit); @Override int read(); @Override int read(char[] buffer, int offset, int length); String readLine(); void reset(); long skip(long amount);  }### Answer:
@Test public void testReadLine() { BufferedReader br = getBufferedReader(); char currentChar; char[] line = new char[8192]; int index = -1; br.mark(8192); while ((currentChar = (char) br.read()) != '\n') { line[++index] = currentChar; } char[] trimedLine = new char[index]; for (int i = 0; i < index; i++) { trimedLine[i] = line[i]; } String stringLine = new String(trimedLine); br.reset(); String sut = br.readLine(); assertEquals(sut, stringLine); br.close(); }