@SuppressWarnings({ "unchecked", "rawtypes" }) public <T extends Collection<U>, U> T subCast(Class<T> r, Class<U> h, Object z) {
    T ll = null;
    if (z == null) return null;
    try {
      ll = r.getConstructor().newInstance();
    } catch (Exception e) {
      throw new CastException(" Array => " + r);
    }
    Type zox; // = z.getClass().getComponentType();
    zox = h;
    if (z instanceof Collection) {
      for (Object o : (Collection) z)
        ((Collection) ll).add(doCast(zox, o));
    } else if (z.getClass().isArray()) {
      int zl = Array.getLength(z);
      for (int i = 0; i < zl; i++) {
        Object next;
        try {
          next = doCast(zox, Array.get(z, i));
        } catch (Throwable t) {
          next = t;
        }
        ((Collection) ll).add(next);
      }
    } else if (((Class) h).isAssignableFrom(z.getClass())) {
      ((Collection) ll).add(z);
    } else ((Collection) ll).add(cast(h, z));
    // else throw new CastException( "unknown type assigning to Collection "+r+": "+z.getClass());
    return ll;
  }