class HistoryReader extends Reader {

    private final List<HistoryEntry> entries;
    private Reader input;

    public HistoryReader(History history) {
        entries = history.getHistoryEntries();
    }

    @Override
    public int read(char @NotNull [] cbuf, int off, int len) throws IOException {
        if (input == null) {
            input = createInternalReader();
        }
        return input.read(Objects.requireNonNull(cbuf, "cbuf"), off, len);
    }

    @Override
    public void close() throws IOException {
        IOUtils.close(input);
    }

    private Reader createInternalReader() {<FILL_FUNCTION_BODY>}
}

        StringBuilder str = new StringBuilder();
        for (HistoryEntry entry : entries) {
            str.append(entry.getLine());
        }
        return new StringReader(str.toString());
    
<methods>public abstract void close() throws java.io.IOException,public void mark(int) throws java.io.IOException,public boolean markSupported() ,public static java.io.Reader nullReader() ,public int read() throws java.io.IOException,public int read(java.nio.CharBuffer) throws java.io.IOException,public int read(char[]) throws java.io.IOException,public abstract int read(char[], int, int) throws java.io.IOException,public boolean ready() throws java.io.IOException,public void reset() throws java.io.IOException,public long skip(long) throws java.io.IOException,public long transferTo(java.io.Writer) throws java.io.IOException<variables>private static final int TRANSFER_BUFFER_SIZE,protected java.lang.Object lock,private static final int maxSkipBufferSize,private char[] skipBuffer