### Question:
FlushStrategies { public static FlushStrategy flushWith(Publisher<?> flushBoundaries) { return batchFlush(MAX_VALUE, flushBoundaries); } private  FlushStrategies(); static FlushStrategy defaultFlushStrategy(); static FlushStrategy flushOnEach(); static FlushStrategy batchFlush(int batchSize, Publisher<?> durationBoundaries); static FlushStrategy flushWith(Publisher<?> flushBoundaries); static FlushStrategy flushOnEnd();  }### Answer:
@Test public void testFlushWith() { setupFor(flushWith(durationSource)); durationSource.onSubscribe(subscription); listener.itemWritten(1); verifyFlush(0); assertTrue(durationSource.isSubscribed()); durationSource.onNext("1"); verifyFlush(1); listener.writeTerminated(); assertTrue(subscription.isCancelled()); }
@Test public void testFlushWithWriteCancelCancelsSource() { setupFor(flushWith(durationSource)); durationSource.onSubscribe(subscription); listener.writeCancelled(); assertTrue(subscription.isCancelled()); }