public static Class<?> getClass(Type type) {
		if (type instanceof Class) {
			return (Class<?>)type;
		}
		
		if (type instanceof ParameterizedType) {
			ParameterizedType paramType = (ParameterizedType)type;
			return getClass(paramType.getRawType());
		}
		else if (type instanceof WildcardType) {
			WildcardType wildcardType = (WildcardType)type;
			if (wildcardType.getLowerBounds() != null && wildcardType.getLowerBounds().length > 0) {
				return getClass(wildcardType.getLowerBounds()[0]);
			}
			
			if (wildcardType.getUpperBounds() != null && wildcardType.getUpperBounds().length > 0) {
				return getClass(wildcardType.getUpperBounds()[0]);
			}
		}

		return null;
	}