FlumeEventQueue implements Writable { synchronized FlumeEventPointer removeHead() { if(size() == 0) { return null; } long value = remove(0); Preconditions.checkState(value != EMPTY); FlumeEventPointer ptr = FlumeEventPointer.fromLong(value); decrementFileID(ptr.getFileID()); return ptr; } FlumeEventQueue(int capacity); @Override synchronized void readFields(DataInput input); @Override synchronized void write(DataOutput output); int getCapacity();  }
@Test public void testQueueIsEmptyAfterCreation() { Assert.assertNull(queue.removeHead()); }