@Override
    public Collection<SlotOffer> offerSlots(
            Collection<? extends SlotOffer> offers,
            TaskManagerLocation taskManagerLocation,
            TaskManagerGateway taskManagerGateway,
            long currentTime) {
        if (!isBlockedTaskManager(taskManagerLocation.getResourceID())) {
            return super.offerSlots(offers, taskManagerLocation, taskManagerGateway, currentTime);
        } else {
            return internalOfferSlotsFromBlockedTaskManager(offers, taskManagerLocation);
        }
    }
@TestTemplate
    void testOfferDuplicateSlots() {
        final TaskManagerLocation taskManager = new LocalTaskManagerLocation();
        final List<ResourceID> blockedTaskManagers = new ArrayList<>();

        final BlocklistDeclarativeSlotPool slotPool =
                BlocklistDeclarativeSlotPoolBuilder.builder()
                        .setBlockedTaskManagerChecker(blockedTaskManagers::contains)
                        .setSlotRequestMaxInterval(slotRequestMaxInterval)
                        .setMainThreadExecutor(componentMainThreadExecutor)
                        .build();
        final ResourceCounter resourceRequirements =
                ResourceCounter.withResource(RESOURCE_PROFILE, 2);
        slotPool.increaseResourceRequirementsBy(resourceRequirements);

        slotPool.tryWaitSlotRequestIsDone();

        SlotOffer slot1 = new SlotOffer(new AllocationID(), 1, RESOURCE_PROFILE);
        SlotOffer slot2 = new SlotOffer(new AllocationID(), 1, RESOURCE_PROFILE);

        // offer and accept slot1
        assertThat(
                        SlotPoolTestUtils.offerSlots(
                                slotPool, Collections.singleton(slot1), taskManager))
                .containsExactly(slot1);

        // block the task manager.
        blockedTaskManagers.add(taskManager.getResourceID());

        // offer slot1 and slot2, accept slot1, reject slot2
        assertThat(SlotPoolTestUtils.offerSlots(slotPool, Arrays.asList(slot1, slot2), taskManager))
                .containsExactly(slot1);
    }