Expose only an interface CollectableSet and let the implementation up to the client (the scanner in our context).
I think that the futur CollectableSet of type dependency will need to have a different implementation of the add to aggregate the metadata on-the-fly.