@Test public void shouldGenerateLotsOfIds() throws InterruptedException { IdGeneratorImpl idGen = new IdGeneratorImpl(); IntStream.range(1, 1000000).forEach(x -> idGen.genId()); TimeUnit.SECONDS.sleep(1); IntStream.range(1, 1000000).forEach(x -> idGen.genId()); }
@Override public synchronized Int128 genId() { return genIdInternal(); }
IdGeneratorImpl implements IdGenerator { @Override public synchronized Int128 genId() { return genIdInternal(); } }
IdGeneratorImpl implements IdGenerator { @Override public synchronized Int128 genId() { return genIdInternal(); } IdGeneratorImpl(); }
IdGeneratorImpl implements IdGenerator { @Override public synchronized Int128 genId() { return genIdInternal(); } IdGeneratorImpl(); Int128 genIdInternal(); @Override synchronized Int128 genId(); }
IdGeneratorImpl implements IdGenerator { @Override public synchronized Int128 genId() { return genIdInternal(); } IdGeneratorImpl(); Int128 genIdInternal(); @Override synchronized Int128 genId();  }