### Question:
LocalTransactionManager implements TransactionManager { @Override public void requiresNew(Runnable block) { if (block == null) { throw new DomaNullPointerException("block"); } requiresNewInternal(TransactionIsolationLevel.DEFAULT, toSupplier(block)); } LocalTransactionManager(LocalTransaction transaction); @Override void required(Runnable block); @Override void required(TransactionIsolationLevel isolationLevel, Runnable block); @Override RESULT required(Supplier<RESULT> supplier); @Override RESULT required(
      TransactionIsolationLevel isolationLevel, Supplier<RESULT> supplier); @Override void requiresNew(Runnable block); @Override void requiresNew(TransactionIsolationLevel isolationLevel, Runnable block); @Override RESULT requiresNew(Supplier<RESULT> supplier); @Override RESULT requiresNew(
      TransactionIsolationLevel isolationLevel, Supplier<RESULT> supplier); @Override void notSupported(Runnable block); @Override void notSupported(TransactionIsolationLevel isolationLevel, Runnable block); @Override RESULT notSupported(Supplier<RESULT> supplier); @Override RESULT notSupported(
      TransactionIsolationLevel isolationLevel, Supplier<RESULT> supplier); @Override void setRollbackOnly(); @Override boolean isRollbackOnly(); @Override void setSavepoint(String savepointName); @Override boolean hasSavepoint(String savepointName); @Override void releaseSavepoint(String savepointName); @Override void rollback(String savepointName);  }### Answer:
@Test public void testRequiresNew_block() { TransactionManager manager = new LocalTransactionManager(transaction); StringBuilder log = new StringBuilder(); log.append(LocalTransactionManagerTest.counter); manager.requiresNew( () -> { log.append(LocalTransactionManagerTest.counter); manager.requiresNew( () -> { log.append(LocalTransactionManagerTest.counter); }); log.append(LocalTransactionManagerTest.counter); }); log.append(LocalTransactionManagerTest.counter); assertEquals("01210", log.toString()); }
@Test public void testRequiresNew_supplier() { LocalTransactionManager manager = new LocalTransactionManager(transaction); String result = manager.requiresNew(() -> "aaa"); assertEquals("aaa", result); }