@Test public void newLongTest() { final SyncLongFactory syncLong = DefaultSyncLongFactory.getInstance(); final SyncLong newLong = syncLong.newLong(); Assert.assertEquals(newLong.getClass(), AtomicLongImpl.class); Assert.assertEquals(0, newLong.get()); long value = newLong.addAndGet(1); Assert.assertEquals(1, value); Assert.assertEquals(1, newLong.get()); value = newLong.addAndGet(66); Assert.assertEquals(67, value); Assert.assertEquals(67, newLong.get()); value = newLong.addAndGet(-15); Assert.assertEquals(52, value); Assert.assertEquals(52, newLong.get()); value = newLong.incrementAndGet(); Assert.assertEquals(53, value); Assert.assertEquals(53, newLong.get()); value = newLong.incrementAndGet(); Assert.assertEquals(54, value); Assert.assertEquals(54, newLong.get()); value = newLong.decrementAndGet(); Assert.assertEquals(53, value); Assert.assertEquals(53, newLong.get()); value = newLong.incrementAndGet(); Assert.assertEquals(54, value); Assert.assertEquals(54, newLong.get()); value = newLong.decrementAndGet(); Assert.assertEquals(53, value); Assert.assertEquals(53, newLong.get()); value = newLong.decrementAndGet(); Assert.assertEquals(52, value); Assert.assertEquals(52, newLong.get()); }
public SyncLong newLong() { return delegate.newLong(); }
DefaultSyncLongFactory implements SyncLongFactory { public SyncLong newLong() { return delegate.newLong(); } }
DefaultSyncLongFactory implements SyncLongFactory { public SyncLong newLong() { return delegate.newLong(); } private  DefaultSyncLongFactory(); }
DefaultSyncLongFactory implements SyncLongFactory { public SyncLong newLong() { return delegate.newLong(); } private  DefaultSyncLongFactory(); static SyncLongFactory getInstance(); SyncLong newLong(); SyncLong newLong(final long initialValue); int getPriority(); }
DefaultSyncLongFactory implements SyncLongFactory { public SyncLong newLong() { return delegate.newLong(); } private  DefaultSyncLongFactory(); static SyncLongFactory getInstance(); SyncLong newLong(); SyncLong newLong(final long initialValue); int getPriority();  }