IOTraceMonitor extends IOMonitorAdapter implements Flushable { @Override public void afterSegmentRead(@NotNull File file, long msb, long lsb, int length, long elapsed) { ioEvents.add(new IOEvent( file.getName(), msb, lsb, length, elapsed, context.get())); if (ioLock.tryLock()) { try { flush(); } finally { ioLock.unlock(); } } } IOTraceMonitor(@NotNull IOTraceWriter traceWriter, @Nullable String contextSpec);  IOTraceMonitor(@NotNull IOTraceWriter traceWriter); void setContext(@NotNull List<String> context); @Override void afterSegmentRead(@NotNull File file, long msb, long lsb, int length,
                                 long elapsed); @Override void flush();  }
@Test public void testEntry() { TraceWriterAssertion traceWriter = new TraceWriterAssertion(); IOTraceMonitor ioTraceMonitor = new IOTraceMonitor(traceWriter); ioTraceMonitor.afterSegmentRead(new File("foo"), 1, 2, 3, 4); traceWriter.assertEntry(",foo,00000000-0000-0001-0000-000000000002,3,4,"); traceWriter.assertFlushed(); }