code: public static synchronized EntityManager getEM(EntityManagerFactory emf, final String propertiesPath,
              final String clazzName)
      {
          /** The client properties. */
          Map<?, Map<String, String>> clientProperties = new HashMap<>();
  
          /** The entity configurations. */
          Map<String, Map<String, String>> entityConfigurations = Collections
                  .synchronizedMap(new HashMap<String, Map<String, String>>());
  
          loadClientProperties(propertiesPath, clazzName, clientProperties, entityConfigurations);
  
          if (emf == null)
          {
  
              StringBuilder puNames = new StringBuilder();
  
              for (Entry<String, Map<String, String>> entry : entityConfigurations.entrySet())
              {
                  if (entry.getValue().get("kundera.pu") != null)
                  {
                      puNames.append(entry.getValue().get("kundera.pu"));
                      puNames.append(",");
                  }
              }
              if (puNames.length() > 0)
              {
                  puNames.deleteCharAt(puNames.length() - 1);
              }
  
              try
              {
  
                  if (puNames.toString().isEmpty())
                  {
                      emf = Persistence.createEntityManagerFactory("testPU", entityConfigurations.get(clazzName));
                  }
  
                  else
                  {
                      emf = Persistence.createEntityManagerFactory(puNames.toString());
                  }
  
              }
              catch (Exception e)
              {
                  LOGGER.error("Unable to create Entity Manager Factory. Caused By: ", e);
                  throw new KunderaException("Unable to create Entity Manager Factory. Caused By: ", e);
              }
          }
  
          return emf.createEntityManager();
      }
docs: Gets the em.
  
  @param emf
  the emf
  @param propertiesPath
  the properties path
  @param clazzName
  the clazz name
  @return the em