@Test public void testSetSeed() { long current = TransactionIDOracle.next(); current += Integer.MAX_VALUE; TransactionIDOracle.setSeed(current); Assert.assertTrue(TransactionIDOracle.next() > System.currentTimeMillis()); }
public static void setSeed(long highest) { long previous; while(highest > (previous = TRANSACTION_ID.get())) { TRANSACTION_ID.compareAndSet(previous, highest); } }
TransactionIDOracle { public static void setSeed(long highest) { long previous; while(highest > (previous = TRANSACTION_ID.get())) { TRANSACTION_ID.compareAndSet(previous, highest); } } }
TransactionIDOracle { public static void setSeed(long highest) { long previous; while(highest > (previous = TRANSACTION_ID.get())) { TRANSACTION_ID.compareAndSet(previous, highest); } } private  TransactionIDOracle(); }
TransactionIDOracle { public static void setSeed(long highest) { long previous; while(highest > (previous = TRANSACTION_ID.get())) { TRANSACTION_ID.compareAndSet(previous, highest); } } private  TransactionIDOracle(); static void setSeed(long highest); static long next(); }
TransactionIDOracle { public static void setSeed(long highest) { long previous; while(highest > (previous = TRANSACTION_ID.get())) { TRANSACTION_ID.compareAndSet(previous, highest); } } private  TransactionIDOracle(); static void setSeed(long highest); static long next();  }