### Question:
CompositeSagaResponse implements SagaResponse { @Override public boolean succeeded() { if (responses.size() > 0) { boolean result = true; for (SagaResponse response : responses) { result = result && response.succeeded(); } return result; } else { return false; } } CompositeSagaResponse(Collection<SagaResponse> responses); @Override boolean succeeded(); @Override String body(); Collection<SagaResponse> responses();  }### Answer:
@Test public void succeededOnlyWhenAllAreSuccessful() throws Exception { when(response1.succeeded()).thenReturn(true); when(response2.succeeded()).thenReturn(true); assertThat(compositeSagaResponse.succeeded(), is(true)); }
@Test public void failedWhenAnyIsNotSuccessful() throws Exception { when(response1.succeeded()).thenReturn(true); when(response2.succeeded()).thenReturn(false); assertThat(compositeSagaResponse.succeeded(), is(false)); }