public boolean beginFlush() {
        try {
            return beginFlush(0, TimeUnit.NANOSECONDS);
        } catch (InterruptedException | TimeoutException e) {
            log.error("Invalid call to OffsetStorageWriter beginFlush() while already flushing, the "
                    + "framework should not allow this");
            throw new ConnectException("OffsetStorageWriter is already flushing");
        }
    }
@Test
    public void testNoOffsetsToFlush() throws InterruptedException, TimeoutException {
        assertFalse(writer.beginFlush(1000L, TimeUnit.MILLISECONDS));
        assertFalse(writer.beginFlush(1000L, TimeUnit.MILLISECONDS));

        // If no offsets are flushed, we should finish immediately and not have made any calls to the
        // underlying storage layer
        verifyNoInteractions(store);
    }