@@ -0,0 +1,2896 @@
+/*%0A * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others.  All rights reserved.%0A *%0A * This program and the accompanying materials are made available under the%0A * terms of the Eclipse Public License v1.0 which accompanies this distribution,%0A * and is available at http://www.eclipse.org/legal/epl-v10.html%0A */%0Apackage org.opendaylight.yangtools.util;%0A%0Aimport static org.junit.Assert.assertEquals;%0Aimport static org.junit.Assert.assertFalse;%0Aimport static org.junit.Assert.assertNull;%0Aimport static org.junit.Assert.assertSame;%0Aimport static org.junit.Assert.fail;%0A%0Aimport java.util.NoSuchElementException;%0Aimport org.junit.Test;%0A%0Apublic class EmptyDequeTest %7B%0A%0A    @Test%0A    public void testEmptyDeque() %7B%0A        final EmptyDeque%3C?%3E deque = EmptyDeque.instance();%0A        assertFalse(deque.offer(null));%0A        assertFalse(deque.offerFirst(null));%0A        assertFalse(deque.offerLast(null));%0A        assertNull(deque.peek());%0A        assertNull(deque.peekFirst());%0A        assertNull(deque.peekLast());%0A        assertNull(deque.poll());%0A        assertNull(deque.pollFirst());%0A        assertNull(deque.pollLast());%0A%0A        assertEquals(0, deque.size());%0A        assertFalse(deque.iterator().hasNext());%0A        assertFalse(deque.descendingIterator().hasNext());%0A        assertEquals(0L, deque.spliterator().estimateSize());%0A%0A        final Object%5B%5D a = deque.toArray();%0A        assertEquals(0, a.length);%0A        assertSame(a, deque.toArray());%0A        assertSame(a, deque.toArray(a));%0A%0A        assertFalse(deque.removeFirstOccurrence(null));%0A        assertFalse(deque.removeLastOccurrence(null));%0A%0A        try %7B%0A            deque.push(null);%0A            fail();%0A        %7D catch (IllegalStateException e) %7B%0A            // expeced%0A        %7D%0A        try %7B%0A            deque.addFirst(null);%0A            fail();%0A        %7D catch (IllegalStateException e) %7B%0A            // expeced%0A        %7D%0A        try %7B%0A            deque.addLast(null);%0A            fail();%0A        %7D catch (IllegalStateException e) %7B%0A            // expeced%0A        %7D%0A%0A        try %7B%0A            deque.getFirst();%0A            fail();%0A        %7D catch (NoSuchElementException e) %7B%0A            // expeced%0A        %7D%0A        try %7B%0A            deque.getLast();%0A            fail();%0A        %7D catch (NoSuchElementException e) %7B%0A            // expeced%0A        %7D%0A        try %7B%0A            deque.pop();%0A            fail();%0A        %7D catch (NoSuchElementException e) %7B%0A            // expeced%0A        %7D%0A        try %7B%0A            deque.remove();%0A            fail();%0A        %7D catch (NoSuchElementException e) %7B%0A            // expeced%0A        %7D%0A        try %7B%0A            deque.removeFirst();%0A            fail();%0A        %7D catch (NoSuchElementException e) %7B%0A            // expeced%0A        %7D%0A        try %7B%0A            deque.removeLast();%0A            fail();%0A        %7D catch (NoSuchElementException e) %7B%0A            // expeced%0A        %7D%0A    %7D%0A%7D%0A

Add EmptyDequeTest