FlumeEventQueue implements Writable { synchronized boolean addTail(FlumeEventPointer e) { long value = e.toLong(); Preconditions.checkArgument(value != EMPTY); if(add(size(), value)) { incrementFileID(e.getFileID()); return true; } return false; } FlumeEventQueue(int capacity); @Override synchronized void readFields(DataInput input); @Override synchronized void write(DataOutput output); int getCapacity();  }
@Test public void testCapacity() { queue = new FlumeEventQueue(1); Assert.assertTrue(queue.addTail(pointer1)); Assert.assertFalse(queue.addTail(pointer2)); }