    @Test
    public void testAcquireExecutionMemory() {

        MemoryManager memoryManager = createStaticMemoryManager(1000L);
        TaskMemoryManager taskMemoryManager = new TaskMemoryManager(memoryManager, 0);
        TestMemoryConsumer consumer = new TestMemoryConsumer(taskMemoryManager);

        // 申请内存
        assert taskMemoryManager.acquireExecutionMemory(100L, consumer) == 100L;
        assert taskMemoryManager.acquireExecutionMemory(400L, consumer) == 400L;
        assert taskMemoryManager.acquireExecutionMemory(400L, consumer) == 400L;
        assert taskMemoryManager.acquireExecutionMemory(200L, consumer) == 200L;
        assert taskMemoryManager.acquireExecutionMemory(100L, consumer) == 100L;
        assert taskMemoryManager.acquireExecutionMemory(100L, consumer) == 100L;

        // 释放内存
        taskMemoryManager.cleanUpAllAllocatedMemory();

        // 申请内存
        assert taskMemoryManager.acquireExecutionMemory(1000L, consumer) == 1000L;
        assert taskMemoryManager.acquireExecutionMemory(100L, consumer) == 100L;
    }