code: public static Class<?> erase(Type type) {
  		if (type instanceof Class<?>) {
  			return (Class<?>) type;
  		}
  		else if (type instanceof ParameterizedType) {
  			return (Class<?>) ((ParameterizedType) type).getRawType();
  		}
  		else if (type instanceof TypeVariable<?>) {
  			TypeVariable<?> tv = (TypeVariable<?>) type;
  			if (tv.getBounds().length == 0)
  				return Object.class;
  			else
  				return erase(tv.getBounds()[0]);
  		}
  		else if (type instanceof GenericArrayType) {
  			GenericArrayType aType = (GenericArrayType) type;
  			Class<?> componentType = erase(aType.getGenericComponentType());
  			return Array.newInstance(componentType, 0).getClass();
  		}
  		else {
  			throw new RuntimeException("not supported: " + type.getClass());
  		}
  	}
docs: Returns the erasure of the given type.
  Taken from GenTyRef project
  TODO replace this once Sitebricks has internal generics utils