code: public void cleanup() {
          ArrayList<ProducerReference> producerReferences = new ArrayList<ProducerReference>(registry.values());
          for (ProducerReference p : producerReferences) {
              try {
                  if (p.get() != null)
                      unregisterProducer(p.get());
              } catch (Exception e) {
                  LOGGER.warn("can't unregister producer " + p, e);
              }
          }
      }
docs: This method is primary used for unit tests.