code: public static void destroyAllActive(ContextualStorage storage)
      {
          Map<Object, ContextualInstanceInfo<?>> contextMap = storage.getStorage();
          for (Map.Entry<Object, ContextualInstanceInfo<?>> entry : contextMap.entrySet())
          {
              Contextual bean = storage.getBean(entry.getKey());
  
              ContextualInstanceInfo<?> contextualInstanceInfo = entry.getValue();
              bean.destroy(contextualInstanceInfo.getContextualInstance(), contextualInstanceInfo.getCreationalContext());
          }
      }
docs: Destroys all the Contextual Instances in the specified ContextualStorage.
  This is a static method to allow various holder objects to cleanup
  properly in &#064;PreDestroy.