code: static void unBindAll(Consumer<EntityManager> function) {
          final Map<EntityManagerFactory,EntityManager> entityManagerMap = entityManagerMap(false);
          if ( entityManagerMap != null ) {
              Iterator<EntityManager> iterator = entityManagerMap.values().iterator();
              while (iterator.hasNext()) {
                  EntityManager entityManager = iterator.next();
                  function.accept(entityManager);
                  iterator.remove();
              }
              doCleanup();
          }
      }
docs: Unbinds all EntityManagers, regardless of EntityManagerFactory, currently associated with the context.
  
  @param function the function to apply to each EntityManager removed