code: public String getMappedPersistenceUnit(String clazzName)
      {
  
          List<String> pus = clazzToPuMap.get(clazzName);
  
          final int _first = 0;
          String pu = null;
  
          if (pus != null && !pus.isEmpty())
          {
              if (pus.size() == 2)
              {
                  onError(clazzName);
              }
              return pus.get(_first);
          }
          else
          {
              Set<String> mappedClasses = this.clazzToPuMap.keySet();
              boolean found = false;
              for (String clazz : mappedClasses)
              {
                  if (found && clazz.endsWith("." + clazzName))
                  {
                      onError(clazzName);
                  }
                  else if (clazz.endsWith("." + clazzName) || clazz.endsWith("$" + clazzName))
                  {
                      pu = clazzToPuMap.get(clazz).get(_first);
                      found = true;
                  }
              }
          }
  
          return pu;
      }
docs: returns mapped persistence unit.
  
  @param clazzName
  clazz name.
  
  @return mapped persistence unit.