@Test
public void getAndAdd() {
getVertx().sharedData().getCounter("foo", ar -> {
assertTrue(ar.succeeded());
Counter counter = ar.result();
counter.getAndAdd(2, ar2 -> {
assertTrue(ar2.succeeded());
assertEquals(0l, ar2.result().longValue());
getVertx().sharedData().getCounter("foo", ar3 -> {
assertTrue(ar3.succeeded());
Counter counter2 = ar3.result();
counter2.getAndAdd(2l, ar4 -> {
assertTrue(ar4.succeeded());
assertEquals(2l, ar4.result().longValue());
counter2.get(ar5 -> {
assertTrue(ar5.succeeded());
assertEquals(4l, ar5.result().longValue());
testComplete();
});
});