Txn { public static <T extends Transactional> void executeRead(T txn, Runnable r) { exec(txn, TxnType.READ, r); }  static void execute(T txn, Runnable r); static X calculate(T txn, Supplier<X> r); static void exec(T txn, TxnType txnType, Runnable r); static X calc(T txn, TxnType txnType, Supplier<X> r); static void executeRead(T txn, Runnable r); static X calculateRead(T txn, Supplier<X> r); static void executeWrite(T txn, Runnable r); static X calculateWrite(T txn, Supplier<X> r);  }
@Test public void txn_basic_01() { long v1 = counter.get() ; assertEquals(0, v1) ; Txn.executeRead(counter, () -> { assertEquals(0, counter.get()) ; }) ; }