static SortedMap<ProcessId, ClientState> getRandomClientState(final int clientSize, final int tpSize, final int partitionSize, final int maxCapacity, final boolean initialAssignment, final Set<TaskId> statefulTasks) {
        final SortedMap<ProcessId, ClientState> clientStates = new TreeMap<>();
        final Map<TaskId, Long> taskLags = statefulTasks.stream().collect(Collectors.toMap(taskId -> taskId, taskId -> 0L));
        final Set<TaskId> taskIds = new HashSet<>();
        for (int i = 0; i < tpSize; i++) {
            for (int j = 0; j < partitionSize; j++) {
                taskIds.add(new TaskId(i, j));
            }
        }

        final Set<TaskId> missingTaskIds = taskLags.keySet().stream().filter(id -> !taskIds.contains(id)).collect(
            Collectors.toSet());
        if (!missingTaskIds.isEmpty()) {
            throw new IllegalArgumentException(missingTaskIds + " missing in all task ids " + taskIds);
        }

        final List<Set<TaskId>> previousActives = getRandomSubset(taskIds, clientSize);
        final List<Set<TaskId>> previousStandbys = getRandomSubset(statefulTasks, clientSize);

        final Random rand = getRandom();

        for (int i = 1; i <= clientSize; i++) {
            final int capacity = rand.nextInt(maxCapacity) + 1;
            final ProcessId processId = processIdForInt(i);
            final ClientState clientState = new ClientState(previousActives.get(i - 1), previousStandbys.get(i - 1), taskLags, EMPTY_CLIENT_TAGS, capacity, processId);
            clientStates.put(processId, clientState);
        }

        if (initialAssignment) {
            Iterator<Entry<ProcessId, ClientState>> iterator = clientStates.entrySet().iterator();
            final List<TaskId> taskIdList = new ArrayList<>(taskIds);
            Collections.shuffle(taskIdList, rand);
            for (final TaskId taskId : taskIdList) {
                if (!iterator.hasNext()) {
                    iterator = clientStates.entrySet().iterator();
                }
                iterator.next().getValue().assignActive(taskId);
            }
        }
        return clientStates;
    }
Builds a ProcessId with a UUID by repeating the given number n. For valid n, it is guaranteed that the returned UUIDs satisfy
the same relation relative to others as their parameter n does: iff n < m, then uuidForInt(n) < uuidForInt(m)
streams/src/test/java/org/apache/kafka/streams/processor/internals/assignment/AssignmentTestUtils.java