ExpiringConsumer implements CloseableWriter<MESSAGE_TYPE> { @Override public Path close() throws IOException, SQLException { return writer.close(); } ExpiringConsumer(CloseableWriter<MESSAGE_TYPE> writer, TemporalAmount expirationDelay, long messagesBeforeExpiring); @Override void write(long timestamp, MESSAGE_TYPE message, Offset offset); @Override Path close();  }
@Test public void closeWithNoMessage() throws IOException, SQLException { final CloseableWriter<Integer> innerMock = mock(CloseableWriter.class); final ExpiringConsumer<Integer> consumer = new ExpiringConsumer<>(innerMock, Duration.ZERO, 10); consumer.close(); verify(innerMock, times(1)).close(); }