### Question:
TailSource extends EventSource.Base { public TailSource(File f, long offset, long waitTime) { this(f, offset, waitTime, false); } TailSource(File f, long offset, long waitTime);  TailSource(File f, long offset, long waitTime, boolean startFromEnd);  TailSource(long waitTime); synchronized void removeCursor(Cursor cursor); @Override void close(); @Override Event next(); @Override synchronized void open(); static SourceBuilder builder(); static SourceBuilder multiTailBuilder(); static final String A_TAILSRCFILE; }### Answer:
@Test public void testTailSource() throws IOException, FlumeSpecException, InterruptedException { File f = File.createTempFile("temp", ".tmp"); f.deleteOnExit(); final CompositeSink snk = new CompositeSink(new ReportTestingContext(), "{ delay(50) => counter(\"count\") }"); final EventSource src = TailSource.builder().build(f.getAbsolutePath()); final CountDownLatch done = new CountDownLatch(1); final int count = 30; runDriver(src, snk, done, count); FileWriter fw = new FileWriter(f); for (int i = 0; i < count; i++) { fw.append("Line " + i + "\n"); fw.flush(); } fw.close(); assertTrue(done.await(10, TimeUnit.SECONDS)); CounterSink ctr = (CounterSink) ReportManager.get().getReportable("count"); assertEquals(count, ctr.getCount()); }