public static void clean(
            Object func, ExecutionConfig.ClosureCleanerLevel level, boolean checkSerializable) {
        clean(func, level, checkSerializable, Collections.newSetFromMap(new IdentityHashMap<>()));
    }
@Test
    void testCleanedNonSerializable() throws Exception {
        MapCreator creator = new NonSerializableMapCreator();
        MapFunction<Integer, Integer> map = creator.getMap();

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

        int result = map.map(3);
        assertThat(result).isEqualTo(4);
    }