Code example for ConcurrentLinkedQueue

    private final Queue<T> outQueue;
    private final Handler<T> handler; 
    public ConcurrentBuffer(final Handler<T> handler) { 
        this.handler = handler;
        outQueue = new ConcurrentLinkedQueue<T>();
    public boolean isOpen() { 
        return true; 
    public void handle(final T t) throws HandlerException {
    public boolean flush() throws HandlerException { 
        int size = outQueue.size();
        for (int i = 0; i < size; i++) {
Connect your IDE to all the code out there  Get Codota for Java