docs: public static Class elementType(Class clazz, int dim) {
          checkArrayType(clazz);
  
          if (dim < 0) {
              throw new IllegalArgumentException("The target dimension should not be less than zero: " + dim);
          }
  
          while (clazz.isArray() && dimension(clazz) > dim) {
              clazz = clazz.getComponentType();
          }
  
          return clazz;
      }