Anyone have idea about it why these duplicate classes are created

They were generated by the compiler. Each Groovy’s closure (and also Java’s anonymous class) is essentially a full-fledged Java class under the hood.