@Test(expected = ExceptionInInitializerError.class) public void initTest() { UoWFactory.getInstance().init("TEST_PERSISTENCE"); UoWFactory.getInstance().init("TEST_PERSISTENCE"); }
public void init(String persistenceUnitName) { if (isInitialized()) throw new ExceptionInInitializerError("Already initialized"); entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName); }
UoWFactory { public void init(String persistenceUnitName) { if (isInitialized()) throw new ExceptionInInitializerError("Already initialized"); entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName); } }
UoWFactory { public void init(String persistenceUnitName) { if (isInitialized()) throw new ExceptionInInitializerError("Already initialized"); entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName); } private  UoWFactory(); }
UoWFactory { public void init(String persistenceUnitName) { if (isInitialized()) throw new ExceptionInInitializerError("Already initialized"); entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName); } private  UoWFactory(); static UoWFactory getInstance(); void init(String persistenceUnitName); IUnitOfWork createUoW(); boolean isInitialized(); }
UoWFactory { public void init(String persistenceUnitName) { if (isInitialized()) throw new ExceptionInInitializerError("Already initialized"); entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnitName); } private  UoWFactory(); static UoWFactory getInstance(); void init(String persistenceUnitName); IUnitOfWork createUoW(); boolean isInitialized();  }