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

        final BlocklistDeclarativeSlotPool slotPool =
                BlocklistDeclarativeSlotPoolBuilder.builder()
                        .setBlockedTaskManagerChecker(blockedTaskManagers::contains)
                        .setSlotRequestMaxInterval(Duration.ZERO)
                        .setMainThreadExecutor(componentMainThreadExecutor)
                        .build();
        SlotOffer slot1 = new SlotOffer(new AllocationID(), 1, RESOURCE_PROFILE);
        SlotOffer slot2 = new SlotOffer(new AllocationID(), 1, RESOURCE_PROFILE);

        // register and accept slot1
        Collection<SlotOffer> acceptedOffers =
                slotPool.registerSlots(
                        Collections.singleton(slot1),
                        taskManager,
                        SlotPoolTestUtils.createTaskManagerGateway(null),
                        0);
        assertThat(acceptedOffers).containsExactly(slot1);

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

        // register slot1 and slot2, accept slot1, reject slot2
        acceptedOffers =
                slotPool.registerSlots(
                        Arrays.asList(slot1, slot2),
                        taskManager,
                        SlotPoolTestUtils.createTaskManagerGateway(null),
                        0);
        assertThat(acceptedOffers).containsExactly(slot1);
    }