// Path: src/main/java/ru/vyarus/java/generics/resolver/context/container/GenericArrayTypeImpl.java
// public class GenericArrayTypeImpl implements GenericArrayType {
// 
//     private final Type componentType;
// 
//     public GenericArrayTypeImpl(final Type componentType) {
//         this.componentType = componentType;
//         if (componentType == null) {
//             throw new IllegalArgumentException("Null component type is not allowed");
//         }
//     }
// 
//     @Override
//     public Type getGenericComponentType() {
//         return componentType;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         boolean res = this == o;
//         if (!res && o instanceof GenericArrayType) {
//             final Type thatComponentType = ((GenericArrayType) o).getGenericComponentType();
//             res = componentType.equals(thatComponentType);
//         }
//         return res;
//     }
// 
//     @Override
//     public int hashCode() {
//         return componentType.hashCode();
//     }
// 
//     @Override
//     public String toString() {
//         return TypeToStringUtils.toStringType(this);
//     }
// }


import ru.vyarus.java.generics.resolver.context.container.GenericArrayTypeImpl;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;
            final String name = type.getName();
            final String typeName;
            if (type.isArray()) {
                typeName = ARRAY_TYPE_SIMPLE_PREFIX + name;
            } else if (type.isPrimitive()) {
                typeName = ARRAY_TYPE_SIMPLE_PREFIX + PRIMITIVE_ARRAY_LETTER.get(type);
            } else {
                typeName = ARRAY_TYPE_OBJECT_PREFIX + name + ";";
            }
            return (Class<T[]>) Class.forName(typeName);
        } catch (ClassNotFoundException e) {
            throw new IllegalStateException("Failed to create array class for "
                    + TypeToStringUtils.toStringType(type), e);
        }
    }

    /**
     * There are two possible cases:
     * <ul>
     * <li>Type is pure class - then arrays is simple class (e.g. {@code int[].class} or {@code List[].class}) </li>
     * <li>Type is generified - then {@link GenericArrayType} must be used (e.g. for parameterized type
     * {@code List<String>})</li>
     * </ul>
     *
     * @param type type to get array of
     * @return array type
     * @see #toArrayClass(Class) for pure class case
     */
    public static Type toArrayType(final Type type) {
        return type instanceof Class ? toArrayClass((Class<?>) type)
// Path: src/main/java/ru/vyarus/java/generics/resolver/context/container/GenericArrayTypeImpl.java
// public class GenericArrayTypeImpl implements GenericArrayType {
// 
//     private final Type componentType;
// 
//     public GenericArrayTypeImpl(final Type componentType) {
//         this.componentType = componentType;
//         if (componentType == null) {
//             throw new IllegalArgumentException("Null component type is not allowed");
//         }
//     }
// 
//     @Override
//     public Type getGenericComponentType() {
//         return componentType;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         boolean res = this == o;
//         if (!res && o instanceof GenericArrayType) {
//             final Type thatComponentType = ((GenericArrayType) o).getGenericComponentType();
//             res = componentType.equals(thatComponentType);
//         }
//         return res;
//     }
// 
//     @Override
//     public int hashCode() {
//         return componentType.hashCode();
//     }
// 
//     @Override
//     public String toString() {
//         return TypeToStringUtils.toStringType(this);
//     }
// }


// Path: src/main/java/ru/vyarus/java/generics/resolver/util/ArrayTypeUtils.java
import ru.vyarus.java.generics.resolver.context.container.GenericArrayTypeImpl;
import java.lang.reflect.GenericArrayType;
import java.lang.reflect.Type;
import java.util.HashMap;
import java.util.Map;

            final String name = type.getName();
            final String typeName;
            if (type.isArray()) {
                typeName = ARRAY_TYPE_SIMPLE_PREFIX + name;
            } else if (type.isPrimitive()) {
                typeName = ARRAY_TYPE_SIMPLE_PREFIX + PRIMITIVE_ARRAY_LETTER.get(type);
            } else {
                typeName = ARRAY_TYPE_OBJECT_PREFIX + name + ";";
            }
            return (Class<T[]>) Class.forName(typeName);
        } catch (ClassNotFoundException e) {
            throw new IllegalStateException("Failed to create array class for "
                    + TypeToStringUtils.toStringType(type), e);
        }
    }

    /**
     * There are two possible cases:
     * <ul>
     * <li>Type is pure class - then arrays is simple class (e.g. {@code int[].class} or {@code List[].class}) </li>
     * <li>Type is generified - then {@link GenericArrayType} must be used (e.g. for parameterized type
     * {@code List<String>})</li>
     * </ul>
     *
     * @param type type to get array of
     * @return array type
     * @see #toArrayClass(Class) for pure class case
     */
    public static Type toArrayType(final Type type) {
        return type instanceof Class ? toArrayClass((Class<?>) type)
                : new GenericArrayTypeImpl(type);