EventSink fail4eva = mock(EventSink.Base.class);
doThrow(new IOException("mock exception")).when(fail4eva).open();
doReturn(new ReportEvent("stub")).when(fail4eva).getMetrics();
// max 5s, backoff initially at 10ms
BackoffPolicy bop = new CappedExponentialBackoff(10, 5000);
final InsistentOpenDecorator<EventSink> insistent = new InsistentOpenDecorator<EventSink>(
fail4eva, bop);
final EventSink sink = new LazyOpenDecorator<EventSink>(insistent);
// create an endless stream of data