static InputStream createDummyInputStream(int payloadSize, Random random, BooleanSupplier hasNext) {
        int idSize = 8;
        String template = String.format("{ \"put\": \"id:test:test::%s\", \"fields\": { \"test\": \"%s\" } }\n",
                                        IntStream.range(0, idSize).mapToObj(__ -> "*").collect(joining()),
                                        IntStream.range(0, payloadSize).mapToObj(__ -> "#").collect(joining()));
        byte[] buffer = template.getBytes(StandardCharsets.UTF_8);
        int idIndex = template.indexOf('*');
        int dataIndex = template.indexOf('#');

        return new SequenceInputStream(new Enumeration<InputStream>() {
            @Override public boolean hasMoreElements() {
                return hasNext.getAsBoolean();
            }
            @Override public InputStream nextElement() {
                for (int i = 0; i <      idSize; i++) buffer[  idIndex + i] = (byte) ('a' + (random.nextInt(26)));
                for (int i = 0; i < payloadSize; i++) buffer[dataIndex + i] = (byte) ('a' + (random.nextInt(26)));
                return new ByteArrayInputStream(buffer);
            }
        });
    }
Creates an input stream that spits out random documents (id and data) for one minute.
vespa-feed-client-cli/src/main/java/ai/vespa/feed/client/impl/CliClient.java