ThingAcknowledgementsFactory { public static Acknowledgements newAcknowledgements(final Collection<Acknowledgement> acknowledgements, final DittoHeaders dittoHeaders) { return Acknowledgements.of(acknowledgements, dittoHeaders); } private  ThingAcknowledgementsFactory(); static Acknowledgements newAcknowledgements(final Collection<Acknowledgement> acknowledgements,
            final DittoHeaders dittoHeaders); static Acknowledgements newAcknowledgements(final EntityIdWithType entityId,
            final Collection<? extends Acknowledgement> acknowledgements,
            final HttpStatusCode statusCode,
            final DittoHeaders dittoHeaders); static Acknowledgements fromJson(final JsonObject jsonObject);  }
@Test public void newAcknowledgementsReturnsExpected() { final Acknowledgements acknowledgements = ThingAcknowledgementsFactory.newAcknowledgements(acknowledgementList, dittoHeaders); try (final AutoCloseableSoftAssertions softly = new AutoCloseableSoftAssertions()) { softly.assertThat(acknowledgements) .as("contains elements") .containsOnlyElementsOf(acknowledgementList); softly.assertThat((CharSequence) acknowledgements.getEntityId()) .as("same entity ID") .isEqualTo(knownAcknowledgement.getEntityId()); softly.assertThat(acknowledgements.getType()) .as("same type") .isEqualTo(Acknowledgements.getType(knownAcknowledgement.getEntityType())); softly.assertThat(acknowledgements.getStatusCode()) .as("same status code") .isEqualTo(HttpStatusCode.FAILED_DEPENDENCY); softly.assertThat(acknowledgements.getDittoHeaders()) .as("same DittoHeaders") .isEqualTo(dittoHeaders); } }