@Override
    public Collection<TaskManagerLocation> getPreferredLocations(
            ExecutionVertexID executionVertexId, Set<ExecutionVertexID> producersToIgnore) {
        CompletableFuture<Collection<TaskManagerLocation>> preferredLocationsFuture =
                asyncPreferredLocationsRetriever.getPreferredLocations(
                        executionVertexId, producersToIgnore);
        Preconditions.checkState(preferredLocationsFuture.isDone());
        // it is safe to do the blocking call here
        // as the underlying InputsLocationsRetriever returns only immediately available locations
        return preferredLocationsFuture.join();
    }
@Test
    void testAvailableInputLocationRetrieval() {
        TestingInputsLocationsRetriever originalLocationRetriever =
                new TestingInputsLocationsRetriever.Builder()
                        .connectConsumerToProducers(EV21, Arrays.asList(EV11, EV12, EV13, EV14))
                        .build();

        originalLocationRetriever.assignTaskManagerLocation(EV11);
        originalLocationRetriever.markScheduled(EV12);
        originalLocationRetriever.failTaskManagerLocation(EV13, new Throwable());
        originalLocationRetriever.cancelTaskManagerLocation(EV14);

        SyncPreferredLocationsRetriever locationsRetriever =
                new DefaultSyncPreferredLocationsRetriever(
                        executionVertexId -> Optional.empty(), originalLocationRetriever);

        Collection<TaskManagerLocation> preferredLocations =
                locationsRetriever.getPreferredLocations(EV21, Collections.emptySet());
        TaskManagerLocation expectedLocation =
                originalLocationRetriever.getTaskManagerLocation(EV11).get().join();

        assertThat(preferredLocations).containsExactly(expectedLocation);
    }