@BeforeClass
  public static void setUpClass() throws Exception {
    helper.setUp();
    ThreadLocalEntityManager.initialize();

    // Factoría y servicios con back-end simulado
    factory = RequestFactoryHelper.create(SocialwindRequestFactory.class);
    service = RequestFactoryHelper.getService(SurferRequest.class);
  }
 @After
 public void tearDown() throws Exception {
   ThreadLocalEntityManager.requestFinalize();
 }
 @Before
 public void setUp() throws Exception {
   ThreadLocalEntityManager.requestBegin();
 }
 @AfterClass
 public static void tearDownClass() throws Exception {
   ThreadLocalEntityManager.destroy();
   helper.tearDown();
 }
 public static final EntityManager entityManager() {
   return ThreadLocalEntityManager.get();
 }