Queue<String> prepareRollingOrder(List<String> podNamesToConsider, List<Pod> pods)   {
        Deque<String> rollingOrder = new ArrayDeque<>();

        for (String podName : podNamesToConsider)   {
            Pod matchingPod = pods.stream().filter(pod -> podName.equals(pod.getMetadata().getName())).findFirst().orElse(null);

            if (matchingPod == null || !Readiness.isPodReady(matchingPod))    {
                // Non-existing or unready pods are handled first
                // This helps to avoid rolling all pods into some situation where they would be all failing
                rollingOrder.addFirst(podName);
            } else {
                // Ready pods are rolled only at the end
                rollingOrder.addLast(podName);
            }
        }

        return rollingOrder;
    }
@Test
    public void testRollingOrderWithAllPodsReady()  {
        List<Pod> pods = List.of(
                renamePod(READY_POD, "my-connect-connect-0"),
                renamePod(READY_POD, "my-connect-connect-1"),
                renamePod(READY_POD, "my-connect-connect-2")
        );

        KafkaConnectRoller roller = new KafkaConnectRoller(RECONCILIATION, CLUSTER, 1_000L, null);
        Queue<String> rollingOrder = roller.prepareRollingOrder(POD_NAMES, pods);

        assertThat(rollingOrder.size(), is(3));
        assertThat(rollingOrder.poll(), is("my-connect-connect-0"));
        assertThat(rollingOrder.poll(), is("my-connect-connect-1"));
        assertThat(rollingOrder.poll(), is("my-connect-connect-2"));
    }