Search in sources :

Example 6 with AtomicShortArray

use of org.lanternpowered.server.util.collect.array.concurrent.AtomicShortArray in project LanternServer by LanternPowered.

the class AtomicShortArrayTest method testGetAndSet.

@Test
public void testGetAndSet() {
    AtomicShortArray array = new AtomicShortArray(SIZE);
    for (int i = 0; i < SIZE; i++) {
        array.set(i, A);
        assertEquals(A, array.getAndSet(i, B));
        assertEquals(B, array.getAndSet(i, E));
        assertEquals(E, array.getAndSet(i, A));
    }
}
Also used : AtomicShortArray(org.lanternpowered.server.util.collect.array.concurrent.AtomicShortArray) Test(org.junit.Test)

Aggregations

AtomicShortArray (org.lanternpowered.server.util.collect.array.concurrent.AtomicShortArray)6 Test (org.junit.Test)5 AtomicIntegerArray (java.util.concurrent.atomic.AtomicIntegerArray)1 AtomicByteArray (org.lanternpowered.server.util.collect.array.concurrent.AtomicByteArray)1 AtomicNibbleArray (org.lanternpowered.server.util.collect.array.concurrent.AtomicNibbleArray)1