### Question:
PersistenceDelegator { void close() { doFlush(); if (!clientMap.isEmpty()) { for (Client client : clientMap.values()) { client.close(); } clientMap.clear(); } onClearProxy(); closed = true; } PersistenceDelegator(final KunderaMetadata kunderaMetadata, final PersistenceCache pc); void persist(Object e); E findById(final Class<E> entityClass, final Object primaryKey); List<E> find(Class<E> entityClass, Object... primaryKeys); List<E> find(Class<E> entityClass, Map<String, String> embeddedColumnMap); void remove(Object e); E merge(E e); void detach(Object entity); Client getClient(EntityMetadata m); Client getClient(final String persistenceUnit); EntityEventDispatcher getEventDispatcher(); boolean isOpen(); void refresh(Object entity); boolean isTransactionInProgress(); PersistenceCache getPersistenceCache(); KunderaMetadata getKunderaMetadata();  }### Answer:
@Test public void testClose() { PersistenceDelegator pd = ((EntityManagerImpl) em).getPersistenceDelegator(); Assert.assertTrue(pd.isOpen()); pd.close(); Assert.assertFalse(pd.isOpen()); Assert.assertTrue(pd.getDelegate().isEmpty()); }