@Test(expected = BadCheckpointException.class)
public void testTruncateMeta() throws Exception {

  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.setLength(0);
  writer.getFD().sync();
  writer.close();
  backingStore = EventQueueBackingStoreFactory.get(
      checkpoint, 10, "test", new FileChannelCounter("test")
  );
}