Extended Persistence Context and merge() example in JPA!

So I was reading this page..

.. and quoting:
EntityManagers obtained through the EntityManagerFactory have an Extended Persistence Context, while injected EntityManagers have a Transaction Persistence Context.  
Extended Persistence Context 
An EntityManager using an extended persistence context maintains the same persistence context for its entire lifecycle. Whether inside a transaction or not, all entities returned from the EntityManager are managed, and the EntityManager never creates two entity instances to represent the same persistent identity. Entities only become detached when you finally close the EntityManager. 
Transaction Persistence Context 
Under the transaction persistence context model, an EntityManager begins a new persistence context with each transaction, and ends the context when the transaction commits or rolls back. When the transaction completes, all entities lose their association with the EntityManager and become detached. If you use an EntityManager with a transaction persistence context model outside of an active transaction, each method invocation creates a new persistence context, performs the method action, and ends the persistence context. For example, consider using the EntityManager.find method outside of a transaction. The EntityManager will create a temporary persistence context, perform the find operation, end the persistence context, and return the detached result object to you. A second call with the same id will return a second detached object.
Here is a simple test I have written for Extended Persistence Context..
package biz.tugay.jpaExamples.service;
 
import biz.tugay.jpaExamples.dao.BaseDaoTest;
import biz.tugay.jpaExamples.model.Employee;
 
import org.junit.Assert;
import org.junit.Test;
 
import javax.persistence.EntityManager;
 
public class ExtendedPersistenceContextRelatedTests extends BaseDaoTest {
 
    @Test
    public void testUniquenessInSamePersistenceContext() {
        // Given
        final EntityManager entityManager = entityManagerService.entityManager();
 
        // When
        final Employee foo = entityManager.find(Employee.class, -1L);
        final Employee bar = entityManager.find(Employee.class, -1L);
        entityManager.close();
 
        // Then
        Assert.assertTrue(foo == bar);
    }
 
    @Test
    public void testUniquenessInIndividualPersistenceContexts() {
        // Given
        EntityManager entityManager = entityManagerService.entityManager();
        final Employee foo = entityManager.find(Employee.class, -1L);
        entityManager.close();
 
        // When
        entityManager = entityManagerService.entityManager();
        final Employee bar = entityManager.find(Employee.class, -1L);
        entityManager.close();
 
        // Then
        Assert.assertTrue(foo != bar);
    }
 
    @Test
    public void testUniquenessAfterMerge() {
        // Given
        EntityManager entityManager = entityManagerService.entityManager();
        final Employee foo = entityManager.find(Employee.class, -1L);
        entityManager.close();
        entityManager = entityManagerService.entityManager();
        final Employee bar = entityManager.find(Employee.class, -1L);
        entityManager.close();
 
        // When
        entityManager = entityManagerService.entityManager();
        final Employee fooMerged = entityManager.merge(foo);
        final Employee barMerged = entityManager.merge(bar);
        entityManager.close();
 
        // Then
        Assert.assertTrue(foo != bar);
        Assert.assertTrue(fooMerged == barMerged);
    }
}