@Test(expected = InvalidProtocolBufferException.class)
public void testCorruptMeta() throws Throwable {

  EventQueueBackingStore backingStore =
      EventQueueBackingStoreFactory.get(checkpoint, 10, "test", new FileChannelCounter("test"));
  backingStore.close();
  Assert.assertTrue(checkpoint.exists());
  File metaFile = Serialization.getMetaDataFile(checkpoint);
  Assert.assertTrue(metaFile.length() != 0);
  RandomAccessFile writer = new RandomAccessFile(metaFile, "rw");
  writer.seek(10);
  writer.writeLong(new Random().nextLong());
  writer.getFD().sync();
  writer.close();
  try {
    backingStore = EventQueueBackingStoreFactory.get(
        checkpoint, 10, "test", new FileChannelCounter("test")
    );
  } catch (BadCheckpointException ex) {
    throw ex.getCause();
  }
}