@Test
public void testSubmitWithNegativeCanCommitResponse() throws Exception {

    doReturn(immediateTrueFluentFuture()).when(mockCohort1).canCommit();
    doReturn(immediateNullFluentFuture()).when(mockCohort1).abort();
    doReturn(Futures.immediateFuture(Boolean.FALSE)).when(mockCohort2).canCommit();
    doReturn(immediateNullFluentFuture()).when(mockCohort2).abort();
    DOMStoreThreePhaseCommitCohort mockCohort3 = mock(DOMStoreThreePhaseCommitCohort.class);
    doReturn(Futures.immediateFuture(Boolean.FALSE)).when(mockCohort3).canCommit();
    doReturn(immediateNullFluentFuture()).when(mockCohort3).abort();
    ListenableFuture<? extends CommitInfo> future = coordinator.commit(
            transaction, Arrays.asList(mockCohort1, mockCohort2, mockCohort3));
    assertFailure(future, null, mockCohort1, mockCohort2, mockCohort3);
}