code: public static Type getArrayComponentType(Type type) {
          if (type instanceof GenericArrayType) {
              return GenericArrayType.class.cast(type).getGenericComponentType();
          }
          if (type instanceof Class<?>) {
              Class<?> clazz = (Class<?>) type;
              if (clazz.isArray()) {
                  return clazz.getComponentType();
              }
          }
          throw new IllegalArgumentException("Not an array type " + type);
      }
docs: Determines the component type for a given array type.
  
  @param type the given array type
  @return the component type of a given array type