ThingsSearchCursor { @SuppressWarnings("OptionalUsedAsFieldOrParameterType") static QueryThings adjust(final Optional<ThingsSearchCursor> cursor, final QueryThings queryThings) { return cursor.map(c -> c.adjustQueryThings(queryThings)).orElse(queryThings); } ThingsSearchCursor(@Nullable final Set<String> namespaces, @Nullable final String correlationId,
            final SortOption sortOption, @Nullable final String filter, final JsonArray values); @Override String toString(); @Override int hashCode(); @Override boolean equals(final Object that);  }
@Test public void correlationIdIsUnchanged() { final ThingsSearchCursor underTest = randomCursor(); final String correlationIdFromCommand = "queryThingsCorrelationId"; final QueryThings queryThings = withCursor(QueryThings.of(DittoHeaders.newBuilder().correlationId(correlationIdFromCommand).build()), underTest); final String correlationIdOfAdjustedCommand = ThingsSearchCursor.adjust(Optional.of(underTest), queryThings) .getDittoHeaders() .getCorrelationId() .orElse(null); assertThat(correlationIdOfAdjustedCommand).isEqualTo(correlationIdFromCommand); assertThat(correlationIdOfAdjustedCommand).isNotEqualTo(getCorrelationId(underTest)); }