code: private String getTypeName(Type type)
      {
          String name;
          if (type instanceof Class) {
              name = ((Class<?>) type).getName();
          } else if (type instanceof ParameterizedType) {
              name = ((Class<?>) ((ParameterizedType) type).getRawType()).getName();
          } else {
              name = type.toString();
          }
  
          return name;
      }
docs: Get class name without generics.
  
  @param type the type
  @return type name without generics