I\'d like to get the generic type of a collection, using reflection, at runtime.
Code (JAVA):
Field collectionObject = object.getClass().getDeclaredF
You can get the generic type of the field you read the object from with Field.getGenericType. Note that the field may be a raw type, be a rare type (generic but with a generic argument that is raw), use the type of the instance, use wildcards, etc.
Field.getGenericType