AcknowledgementAggregator { public boolean receivedAllRequestedAcknowledgements() { return expectedLabels.isEmpty(); } private  AcknowledgementAggregator(final EntityIdWithType entityId,
            final CharSequence correlationId,
            final Duration timeout,
            final HeaderTranslator headerTranslator); static AcknowledgementAggregator getInstance(final EntityIdWithType entityId,
            final CharSequence correlationId,
            final Duration timeout,
            final HeaderTranslator headerTranslator); static AcknowledgementAggregator getInstance(final NamespacedEntityIdWithType entityId,
            final CharSequence correlationId,
            final Duration timeout,
            final HeaderTranslator headerTranslator); String getCorrelationId(); void addAcknowledgementRequest(final AcknowledgementRequest acknowledgementRequest); void addAcknowledgementRequests(final Collection<AcknowledgementRequest> acknowledgementRequests); void addReceivedAcknowledgment(final Acknowledgement acknowledgement); boolean receivedAllRequestedAcknowledgements(); boolean isSuccessful(); Acknowledgements getAggregatedAcknowledgements(final DittoHeaders dittoHeaders);  }
@Test public void receivedAllRequestedAcknowledgements() { final AcknowledgementAggregator underTest = AcknowledgementAggregator.getInstance(ENTITY_ID, correlationId, TIMEOUT, HEADER_TRANSLATOR); final List<Acknowledgement> acknowledgements = createAcknowledgements(3, HttpStatusCode.NO_CONTENT); acknowledgements.addAll(createAcknowledgements(2, HttpStatusCode.BAD_REQUEST)); acknowledgements.forEach( ack -> underTest.addAcknowledgementRequest(AcknowledgementRequest.of(ack.getLabel()))); acknowledgements.forEach(underTest::addReceivedAcknowledgment); assertThat(underTest.receivedAllRequestedAcknowledgements()).isTrue(); }