@Test
    public void testIdempotentClose() {
        // Go through the closure process
        consumerTask.close();
        consumerTask.closeConsumer();

        // Go through the closure process again
        // Note: After ConsumerTask is closed, the second close() normally does not call closeConsumer() again
        consumerTask.close();
    }
Tests that the consumer task shuts down gracefully when there were no assignments.
storage/src/test/java/org/apache/kafka/server/log/remote/metadata/storage/ConsumerTaskTest.java