List of usage examples for java.util.concurrent.atomic AtomicIntegerArray incrementAndGet
public final int incrementAndGet(int i)
From source file:Main.java
public static void main(String[] argv) throws Exception { AtomicIntegerArray atomicIntegerArray = new AtomicIntegerArray(new int[] { 0, 1, 2, 3 }); atomicIntegerArray.incrementAndGet(0); System.out.println(atomicIntegerArray); }
From source file:com.netflix.iep.http.RxHttpTest.java
@Test public void absoluteRedirect() throws Exception { int code = 200; statusCode.set(code);//from ww w .j a v a 2s . co m redirects.set(2); AtomicIntegerArray expected = copy(statusCounts); expected.incrementAndGet(code); expected.addAndGet(302, 3); final CountDownLatch latch = new CountDownLatch(1); final AtomicReference<Throwable> throwable = new AtomicReference<>(); rxHttp.get(uri("/absoluteRedirect")).subscribe(Actions.empty(), new Action1<Throwable>() { @Override public void call(Throwable t) { throwable.set(t); latch.countDown(); } }, new Action0() { @Override public void call() { latch.countDown(); } }); latch.await(); Assert.assertNull(throwable.get()); assertEquals(expected, statusCounts); }