private static <R> LinkedList<QueryResult<R>> getAllResults(
        final StateQueryResult<R> result) {
        final LinkedList<QueryResult<R>> allResults =
            new LinkedList<>(result.getPartitionResults().values());
        if (result.getGlobalResult() != null) {
            allResults.add(result.getGlobalResult());
        }
        return allResults;
    }
Repeatedly runs the query until the response is valid and then return the response.
<p>
Validity in this case means that the response position is up to the specified bound.
<p>
Once position bounding is generally supported, we should migrate tests to wait on the
expected response position.
streams/src/test/java/org/apache/kafka/streams/integration/utils/IntegrationTestUtils.java