code: public static Class<?> getClassFromType(final Type type) {
          Class<?> returnClass = null;
          if (type instanceof Class<?>) {
              returnClass = (Class<?>) type;
          } else if (type instanceof ParameterizedType) {
              returnClass = getClassFromType(((ParameterizedType) type).getRawType());
          }
          return returnClass;
      }
docs: Return the Class object for the given type.
  
  @param type the given type to cast into Class
  
  @return the Class casted object