public static void clean(
            Object func, ExecutionConfig.ClosureCleanerLevel level, boolean checkSerializable) {
        clean(func, level, checkSerializable, Collections.newSetFromMap(new IdentityHashMap<>()));
    }
@Test
    void testComplexTopLevelClassClean() throws Exception {
        MapFunction<Integer, Integer> complexMap =
                new ComplexMap((MapFunction<Integer, Integer>) value -> value + 1);

        ClosureCleaner.clean(complexMap, ExecutionConfig.ClosureCleanerLevel.RECURSIVE, true);

        int result = complexMap.map(3);

        assertThat(result).isEqualTo(5);
    }