@Test
public void testReplicateLogEntries_EntryTimestampBeforeSubscriptionTimestamp() throws IOException {

    byte[] rowKey = Bytes.toBytes("rowkey");
    byte[] payloadDataBeforeTimestamp = Bytes.toBytes("payloadBeforeTimestamp");
    byte[] payloadDataOnTimestamp = Bytes.toBytes("payloadOnTimestamp");
    byte[] payloadDataAfterTimestamp = Bytes.toBytes("payloadAfterTimestamp");
    WAL.Entry hlogEntryBeforeTimestamp = createHlogEntry(TABLE_NAME, SUBSCRIPTION_TIMESTAMP - 1,
            new KeyValue(rowKey, DATA_COLFAM, PAYLOAD_QUALIFIER, payloadDataBeforeTimestamp));
    WAL.Entry hlogEntryOnTimestamp = createHlogEntry(TABLE_NAME, SUBSCRIPTION_TIMESTAMP,
            new KeyValue(rowKey, DATA_COLFAM, PAYLOAD_QUALIFIER, payloadDataOnTimestamp));
    WAL.Entry hlogEntryAfterTimestamp = createHlogEntry(TABLE_NAME, SUBSCRIPTION_TIMESTAMP + 1,
            new KeyValue(rowKey, DATA_COLFAM, PAYLOAD_QUALIFIER, payloadDataAfterTimestamp));
    replicateWALEntry(new WAL.Entry[]{hlogEntryBeforeTimestamp});
    replicateWALEntry(new WAL.Entry[]{hlogEntryOnTimestamp});
    replicateWALEntry(new WAL.Entry[]{hlogEntryAfterTimestamp});
    SepEvent expectedEventOnTimestamp = SepEvent.create(TABLE_NAME, rowKey,
            hlogEntryOnTimestamp.getEdit().getCells(), payloadDataOnTimestamp);
    SepEvent expectedEventAfterTimestamp = SepEvent.create(TABLE_NAME, rowKey,
            hlogEntryAfterTimestamp.getEdit().getCells(), payloadDataAfterTimestamp);
    // Event should be published for data on or after the subscription timestamp, but not before
    verify(eventListener, times(1)).processEvents(Lists.newArrayList(expectedEventOnTimestamp));
    verify(eventListener, times(1)).processEvents(Lists.newArrayList(expectedEventAfterTimestamp));
    verifyNoMoreInteractions(eventListener);
}