### Question:
BufferedLogger implements AutoCloseable { public @NonNull Entry log(String message) { Entry entry = new Entry(message); queue.add(entry); return entry; } BufferedLogger(int maxEntries); void e(String s); void flush(); boolean flush(long millis); PrintStream printTo(PrintStream ps, boolean printTimestamp); @NonNull Entry log(String message); @NonNull Entry d(String message); @NonNull List<Entry> getLast(int maxEntries); List<Entry> slice(long id, int maxEntries); void clear(); List<Entry> getCopy(); void interceptStdOut(); @Override void close(); void stopInterceptingStdOut();  }### Answer:
@Test public void log() throws Exception { BufferedLogger log = new BufferedLogger(3); for (int i = 0; i < 10; i++) { log.log("line " + i); } log.flush(); assertEquals("line 7,line 8,line 9", str(log.getCopy())); }