@Test public void dataSharingTest() throws Exception { DBStartableTransactionRunnable run = new DBStartableTransactionRunnable(); ProvidingTransactionRunnable<DBTransaction, MyInterfaceWithDataA1> tr1 = new TR1(); tr1.runIn(run); TransactionRunnable<DBTransaction> tr2 = new TR2(); TransactionRunnable<MyInterfaceWithDataA1> tr2WithNewCapabilities = tr2.runIn(tr1.asProvider()); new TR3().runIn(tr2WithNewCapabilities); run.start(); }
public TransactionRunnable<P> asProvider() { return (TransactionRunnable<P>) this; }
ProvidingTransactionRunnable extends TransactionRunnable<R> { public TransactionRunnable<P> asProvider() { return (TransactionRunnable<P>) this; } }
ProvidingTransactionRunnable extends TransactionRunnable<R> { public TransactionRunnable<P> asProvider() { return (TransactionRunnable<P>) this; }  }
ProvidingTransactionRunnable extends TransactionRunnable<R> { public TransactionRunnable<P> asProvider() { return (TransactionRunnable<P>) this; }  TransactionRunnable<P> asProvider(); }
ProvidingTransactionRunnable extends TransactionRunnable<R> { public TransactionRunnable<P> asProvider() { return (TransactionRunnable<P>) this; }  TransactionRunnable<P> asProvider();  }