/*
 * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
 * and is available at http://www.eclipse.org/legal/epl-v10.html
 */
package org.opendaylight.controller.cluster.access.client;

import java.util.AbstractQueue;
import java.util.Collections;
import java.util.Iterator;
import java.util.Queue;

/**
 * A specialized always-empty implementation of {@link java.util.Queue}. This implementation will always refuse new
 * elements in its {@link #offer(Object)} method.

 * @author Robert Varga
 *
 * @param <E> the type of elements held in this collection
 */
// TODO: move this class into yangtools.util
final class EmptyQueue<T> extends AbstractQueue<T> {
    private static final EmptyQueue<?> INSTANCE = new EmptyQueue<>();

    private EmptyQueue() {
        // No instances
    }

    @SuppressWarnings("unchecked")
    static <T> Queue<T> getInstance() {
        return (Queue<T>) INSTANCE;
    }

    @Override
    public boolean offer(final T e) {
        return false;
    }

    @Override
    public T poll() {
        return null;
    }

    @Override
    public T peek() {
        return null;
    }

    @Override
    public Iterator<T> iterator() {
        return Collections.emptyIterator();
    }

    @Override
    public int size() {
        return 0;
    }
}
@@ -361,16 +361,59 @@
 lient;%0A%0A
+import com.google.common.annotations.Beta;%0A
 import j
@@ -436,16 +436,16 @@
 tQueue;%0A
-
 import j
@@ -824,16 +824,29 @@
 ls.util%0A
+@Beta%0Apublic 
 final cl
@@ -860,17 +860,17 @@
 tyQueue%3C
-T
+E
 %3E extend
@@ -885,17 +885,17 @@
 ctQueue%3C
-T
+E
 %3E %7B%0A    
@@ -1058,16 +1058,23 @@
 d%22)%0A    
+public 
 static %3C
@@ -1189,17 +1189,17 @@
 r(final 
-T
+E
  e) %7B%0A  
@@ -1250,17 +1250,17 @@
  public 
-T
+E
  poll() 
@@ -1314,17 +1314,17 @@
  public 
-T
+E
  peek() 
@@ -1387,17 +1387,17 @@
 terator%3C
-T
+E
 %3E iterat

make EmptyQueue public