// if the collection is mutable, then replace the existing addTo and removeFrom facets with equivalents that
// also post to the event bus.
//
// here we support the deprecated annotations
//
final PostsCollectionAddedToEvent postsCollectionAddedToEvent = Annotations.getAnnotation(method, PostsCollectionAddedToEvent.class);
final PostsCollectionRemovedFromEvent postsCollectionRemovedFromEvent = Annotations.getAnnotation(method, PostsCollectionRemovedFromEvent.class);
final CollectionAddToFacet collectionAddToFacet = holder.getFacet(CollectionAddToFacet.class);
if (collectionAddToFacet != null) {
// the current collectionAddToFacet will end up as the underlying facet of one of these facets to be created.
final CollectionAddToFacetForInteractionAbstract replacementFacet;
if(collectionInteraction != null) {
replacementFacet = new CollectionAddToFacetForCollectionInteractionAnnotation(
collectionInteractionEventType, getterFacet, collectionAddToFacet, collectionInteractionFacet, holder, servicesInjector);
} else if (postsCollectionAddedToEvent != null) {
replacementFacet = new CollectionAddToFacetForPostsCollectionAddedToEventAnnotation(
postsCollectionAddedToEvent.value(), getterFacet, collectionAddToFacet, collectionInteractionFacet, holder, servicesInjector);
} else {
replacementFacet = new CollectionAddToFacetForCollectionInteractionDefault(
collectionInteractionEventType, getterFacet, collectionAddToFacet, collectionInteractionFacet, holder, servicesInjector);
}
FacetUtil.addFacet(replacementFacet);