@@ -0,0 +1,1958 @@
+/*%0A * Licensed to CRATE Technology GmbH (%22Crate%22) under one or more contributor%0A * license agreements.  See the NOTICE file distributed with this work for%0A * additional information regarding copyright ownership.  Crate licenses%0A * this file to you under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.  You may%0A * obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the%0A * License for the specific language governing permissions and limitations%0A * under the License.%0A *%0A * However, if you have executed another commercial license agreement%0A * with Crate these terms will supersede the license and you may use the%0A * software solely pursuant to the terms of the relevant commercial agreement.%0A */%0A%0Apackage io.crate.core.collections;%0A%0Aimport org.junit.Test;%0A%0Aimport java.util.concurrent.CountDownLatch;%0A%0Aimport static org.hamcrest.core.Is.is;%0Aimport static org.junit.Assert.assertThat;%0A%0Apublic class NonBlockingArrayQueueTest %7B%0A%0A    @Test%0A    public void testOffer() throws Exception %7B%0A        final NonBlockingArrayQueue%3CString%3E strings = new NonBlockingArrayQueue%3C%3E(15_000);%0A%0A        int THREADS = 20;%0A        final CountDownLatch latch = new CountDownLatch(THREADS);%0A%0A        for (int i = 0; i %3C THREADS; i++) %7B%0A            Thread t = new Thread(new Runnable() %7B%0A                @Override%0A                public void run() %7B%0A                    for (int j = 0; j %3C 1000; j++) %7B%0A                        strings.add(%22foo%22);%0A                    %7D%0A%0A                    latch.countDown();%0A                %7D%0A            %7D);%0A            t.start();%0A        %7D%0A%0A        latch.await();%0A        assertThat(strings.size(), is(15_000));%0A    %7D%0A%7D%0A

add a test for the NonBlockingArrayQueue