static void verifyStandbySatisfyRackReplica(
        final Set<TaskId> taskIds,
        final Map<ProcessId, String> racksForProcess,
        final Map<ProcessId, ClientState> clientStateMap,
        final Integer replica,
        final boolean relaxRackCheck,
        final Map<ProcessId, Integer> standbyTaskCount
    ) {
        if (standbyTaskCount != null) {
            for (final Entry<ProcessId, ClientState> entry : clientStateMap.entrySet()) {
                final int expected = standbyTaskCount.get(entry.getKey());
                final int actual = entry.getValue().standbyTaskCount();
                assertEquals(expected, actual, "StandbyTaskCount for " + entry.getKey() + " doesn't match");
            }
        }
        for (final TaskId taskId : taskIds) {
            int activeCount = 0;
            int standbyCount = 0;
            final Map<String, ProcessId> racks = new HashMap<>();
            for (final Map.Entry<ProcessId, ClientState> entry : clientStateMap.entrySet()) {
                final ProcessId processId = entry.getKey();
                final ClientState clientState = entry.getValue();

                if (!relaxRackCheck && clientState.hasAssignedTask(taskId)) {
                    final String rack = racksForProcess.get(processId);
                    assertThat("Task " + taskId + " appears in both " + processId + " and " + racks.get(rack), racks.keySet(), not(hasItems(rack)));
                    racks.put(rack, processId);
                }

                boolean hasActive = false;
                if (clientState.hasActiveTask(taskId)) {
                    activeCount++;
                    hasActive = true;
                }

                boolean hasStandby = false;
                if (clientState.hasStandbyTask(taskId)) {
                    standbyCount++;
                    hasStandby = true;
                }

                assertFalse(hasActive && hasStandby, clientState + " has both active and standby task " + taskId);
            }

            assertEquals(1, activeCount, "Task " + taskId + " should have 1 active task");
            if (replica != null) {
                assertEquals(replica.intValue(), standbyCount, "Task " + taskId + " has wrong replica count");
            }
        }
    }
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