@Override
    public void reserveSlot(AllocationID allocationId) {
        Preconditions.checkState(
                freeSlots.remove(allocationId),
                "Slot %s does not exist in free slots",
                allocationId);
    }
@Test
    void testReserveSlot() {
        final ResourceID resourceId = ResourceID.generate();
        final PhysicalSlot slot1 = createAllocatedSlot(resourceId);
        final PhysicalSlot slot2 = createAllocatedSlot(resourceId);
        final Map<AllocationID, PhysicalSlot> slots = new HashMap<>();

        slots.put(slot1.getAllocationId(), slot1);
        slots.put(slot2.getAllocationId(), slot2);

        final FreeSlotTracker freeSlotTracker =
                FreeSlotTrackerTestUtils.createDefaultFreeSlotTracker(slots);
        for (AllocationID candidate : freeSlotTracker.getAvailableSlots()) {
            SlotInfo selectSlot = freeSlotTracker.getSlotInfo(candidate);
            assertThat(slots.get(selectSlot.getAllocationId())).isEqualTo(selectSlot);
            freeSlotTracker.reserveSlot(selectSlot.getAllocationId());
            break;
        }

        assertThat(freeSlotTracker.getAvailableSlots())
                .hasSize(1)
                .containsAnyOf(slot1.getAllocationId(), slot2.getAllocationId());
    }