code: @SuppressWarnings("unchecked")
      public static <T> Class<T[]> toArrayClass(final Class<T> type) {
          try {
              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 " + type.getSimpleName(), e);
          }
      }
docs: Returns array class for provided class. For example, {@code toArrayClass(int) == int[]} and
  {@code toArrayClass(List) == List[]}.
  <p>
  Pay attention that primitive arrays are returned for primitive types (no boxing applied automatically).
  Also, primitives are not playing well with generalization, so you can't write
  {@code Class<int[]> res = ArrayTypeUtils.toArrayClass(int.class)} (because IDE assumes {@code Integer[]} as
  the return type, whereas actually {@code int[].class} will be returned). Use instead:
  {@code Class<?> res = ArrayTypeUtils.toArrayClass(int.class)} or {@link #toArrayType(Type)} method.
  
  @param type class to get array of
  @param <T>  parameter type
  @return class representing array of provided type
  @see <a href="https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.3">jvm arrays spec</a>
  @see #toArrayType(Type) for general array case