code: protected Set<String> getSortedAppNames()
      {
          if (applList == null)
          {
              return Collections.emptySet();
          }
  
          Set<String> appNames = applList.keySet();
  
          // Per Collections.synchronizedMap javadoc, must synchronize on map when
          // iterating over any of the collection views.
          synchronized (applList)
          {
              return new TreeSet<String>(appNames);
          }
      }
docs: Convenience method for trace that obtains a sorted list of the known JPA
  application names. This method is thread safe.