@Test
public void testCanCommit() throws Exception {

    final ListenableFuture<Boolean> canCommit = cohort.canCommit();
    final ModifyTransactionRequest request = transaction.expectTransactionRequest(ModifyTransactionRequest.class);
    assertTrue(request.getPersistenceProtocol().isPresent());
    assertEquals(PersistenceProtocol.SIMPLE, request.getPersistenceProtocol().get());
    final RequestSuccess<?, ?> success = new TransactionCommitSuccess(transaction.getTransaction().getIdentifier(),
            transaction.getLastReceivedMessage().getSequence());
    transaction.replySuccess(success);
    assertEquals(Boolean.TRUE, getWithTimeout(canCommit));
}