ImmutableAcknowledgement implements Acknowledgement { public static <T extends EntityIdWithType> ImmutableAcknowledgement<T> of(final AcknowledgementLabel label, final T entityId, final HttpStatusCode statusCode, final DittoHeaders dittoHeaders, @Nullable final JsonValue payload) { return new ImmutableAcknowledgement<>(label, entityId, statusCode, dittoHeaders, payload); } private  ImmutableAcknowledgement(final AcknowledgementLabel label,
            final T entityId,
            final HttpStatusCode statusCode,
            final DittoHeaders dittoHeaders,
            @Nullable final JsonValue payload); static ImmutableAcknowledgement<T> of(final AcknowledgementLabel label,
            final T entityId,
            final HttpStatusCode statusCode,
            final DittoHeaders dittoHeaders,
            @Nullable final JsonValue payload); @Override AcknowledgementLabel getLabel(); @Override T getEntityId(); @Override boolean isSuccess(); @Override boolean isTimeout(); @Override HttpStatusCode getStatusCode(); @Override Optional<JsonValue> getEntity(final JsonSchemaVersion schemaVersion); @Override Acknowledgement setEntity(final @Nullable JsonValue payload); @Override DittoHeaders getDittoHeaders(); @Override ImmutableAcknowledgement<T> setDittoHeaders(final DittoHeaders dittoHeaders); @Override EntityType getEntityType(); @Override String getType(); @Override JsonObject toJson(final JsonSchemaVersion schemaVersion, final Predicate<JsonField> thePredicate); @Override boolean equals(@Nullable final Object o); @Override int hashCode(); @Override String toString();  }
@Test public void tryToGetInstanceWithNullAcknowledgementLabel() { assertThatNullPointerException() .isThrownBy( () -> ImmutableAcknowledgement.of(null, KNOWN_ENTITY_ID, KNOWN_STATUS_CODE, dittoHeaders, null)) .withMessage("The label must not be null!") .withNoCause(); }
@Test public void tryToGetInstanceWithNullEntityId() { assertThatNullPointerException() .isThrownBy( () -> ImmutableAcknowledgement.of(KNOWN_ACK_LABEL, null, KNOWN_STATUS_CODE, dittoHeaders, null)) .withMessage("The entityId must not be null!") .withNoCause(); }
@Test public void tryToGetInstanceWithNullStatusCode() { assertThatNullPointerException() .isThrownBy( () -> ImmutableAcknowledgement.of(KNOWN_ACK_LABEL, KNOWN_ENTITY_ID, null, dittoHeaders, null)) .withMessage("The statusCode must not be null!") .withNoCause(); }
@Test public void tryToGetInstanceWithNullDittoHeaders() { assertThatNullPointerException() .isThrownBy(() -> ImmutableAcknowledgement.of(KNOWN_ACK_LABEL, KNOWN_ENTITY_ID, KNOWN_STATUS_CODE, null, null)) .withMessage("The dittoHeaders must not be null!") .withNoCause(); }