code: @SuppressWarnings("rawtypes")
      private static Class<?> getRawClass(Type type) {
          if (type instanceof Class) {
              return (Class<?>) type;
          }
          if (type instanceof TypeVariable) {
              return getRawClass(((TypeVariable) type).getBounds()[0]);
          }
          if (type instanceof ParameterizedType) {
              return getRawClass(((ParameterizedType) type).getRawType());
          }
          if (type instanceof GenericArrayType) {
              return getRawClass(((GenericArrayType) type).getGenericComponentType());
          }
          if (type instanceof WildcardType) {
              return getRawClass(((WildcardType) type).getUpperBounds()[0]);
          }
          throw new RuntimeException("Can't get raw class from " + type);
      }
docs: Gets the raw class of a java <code>type</code>. Returns:
  <ul>
  <li>Inner class for arrays</li>
  <li>Non parameterized class for parameterized type</li>
  <li>Upper bounds class for type variable</li>
  </ul>
  
  @param type
  java type
  @return Corresponding java class