code: public static Class getTypeClass(Type type)
      {
          Class typeClassClass = null;
  
          if (type instanceof Class) {
              typeClassClass = (Class) type;
          } else if (type instanceof ParameterizedType) {
              typeClassClass = (Class) ((ParameterizedType) type).getRawType();
          } else if (type instanceof GenericArrayType) {
              Class<?> arrrayParameter = getTypeClass(((GenericArrayType) type).getGenericComponentType());
              if (arrrayParameter != null) {
                  typeClassClass = Array.newInstance(arrrayParameter, 0).getClass();
              }
          }
  
          return typeClassClass;
      }
docs: Extract the main class from the passed {@link Type}.
  
  @param type the generic {@link Type}
  @return the main Class of the generic {@link Type}
  @since 4.0M1