@Override
    public void onNewResourcesAvailable() {
        checkDesiredOrSufficientResourcesAvailable();
    }
@Test
    void testSchedulingWithSufficientResourcesAfterStabilizationTimeout() {
        Duration initialResourceTimeout = Duration.ofMillis(-1);
        Duration stabilizationTimeout = Duration.ofMillis(50_000L);

        WaitingForResources wfr =
                new WaitingForResources(
                        ctx,
                        LOG,
                        initialResourceTimeout,
                        stabilizationTimeout,
                        ctx.getClock(),
                        null);
        // sufficient resources available
        ctx.setHasDesiredResources(() -> false);
        ctx.setHasSufficientResources(() -> true);

        // notify about sufficient resources
        wfr.onNewResourcesAvailable();

        ctx.setExpectCreatingExecutionGraph();

        // execute all runnables and trigger expected state transition
        final Duration afterStabilizationTimeout = stabilizationTimeout.plusMillis(1);
        ctx.advanceTimeByMillis(afterStabilizationTimeout.toMillis());

        ctx.runScheduledTasks(afterStabilizationTimeout.toMillis());

        assertThat(ctx.hasStateTransition()).isTrue();
    }