public static PersistenceUnitInfo findPersistenceUnit(String unitName, Collection<? extends PersistenceUnitInfo> units) {
    if (units == null || unitName == null) {
      return null;
    }

    for (PersistenceUnitInfo unit : units) {
      if (unitName.equals(unit.getPersistenceUnitName())) {
        return unit;
      }
    }
    return null;
  }
public static PersistenceUnitInfo findPersistenceUnit(String unitName, Collection<? extends PersistenceUnitInfo> units) {
    if (units == null || unitName == null) {
      return null;
    }

    for (PersistenceUnitInfo unit : units) {
      if (unitName.equals(unit.getPersistenceUnitName())) {
        return unit;
      }
    }
    return null;
  }
public static PersistenceUnitInfo findPersistenceUnit ( String unitName , Collection < ? extends PersistenceUnitInfo > units ) { if ( units == null || unitName == null ) { return null ; } for ( PersistenceUnitInfo unit : units ) { if ( unitName . equals ( unit . getPersistenceUnitName ( ) ) ) { return unit ; } } return null ; }
Parse the persistence.xml files referenced by the URLs in the collection

@param persistenceXml
@return A collection of parsed persistence units, or null if nothing has been found
Parse the persistence . xml files referenced by the URLs in the collection