public void close() {
        runWithLock(
                () -> {
                    closed = true;
                    if (!udfFinished) {
                        cacheNotEmpty.signalAll();
                        waitUDFFinished();
                    }
                    udfExecutor.shutdown();
                });
    }
@Test
    void testInitialize() throws ExecutionException, InterruptedException {
        CompletableFuture<Object> result = new CompletableFuture<>();
        MapPartitionIterator<String> iterator =
                new MapPartitionIterator<>(stringIterator -> result.complete(null));
        result.get();
        assertThat(result).isCompleted();
        iterator.close();
    }