### Question:
FailOverSink extends EventSink.Base { public FailOverSink(EventSink primary, EventSink backup) { Preconditions.checkNotNull(primary); Preconditions.checkNotNull(backup); this.primary = primary; this.backup = backup; suffix = uniq.getAndIncrement(); this.name = "failover_" + suffix; this.R_FAILS = "rpt." + name + ".fails"; this.R_BACKUPS = "rpt." + name + ".backups"; } FailOverSink(EventSink primary, EventSink backup); @Override void append(Event e); @Override void close(); @Override void open(); @Override ReportEvent getReport(); @Override void getReports(String namePrefix, Map<String, ReportEvent> reports); @Override String getName(); static SinkBuilder builder();  }### Answer:
@Test public void testFailOverSink() throws IOException { CounterSink primary = new CounterSink("primary"); CounterSink secondary = new CounterSink("backup"); IntervalFlakeyEventSink<EventSink> flake = new IntervalFlakeyEventSink<EventSink>( primary, 2); FailOverSink failsink = new FailOverSink(flake, secondary); failsink.open(); for (int i = 0; i < 100; i++) { Event e = new EventImpl(("event " + i).getBytes()); failsink.append(e); } failsink.close(); Assert.assertEquals(primary.getCount(), secondary.getCount()); }