class TypeUtils {

	public static Type getComponentType(Type type)
	{
		if (type instanceof Class<?>)
		{
			Class<?> klass = (Class<?>) type;
			
			return klass.isArray() ? klass.getComponentType() : null;
		}
		
		if (type instanceof GenericArrayType)
		{
			return ((GenericArrayType) type).getGenericComponentType();
		}
		
		return null;
	}

	private  TypeUtils();

}