ph-schematron/src/main/java/com/helger/schematron/pure/preprocess/PreprocessorIDPool.java
@Nullable
  public String getUniqueID (@Nullable final String sID)
  {
    if (sID == null)
      return null;

    if (m_aUsedIDs.add (sID))
    {
      // Unique ID
      return sID;
    }

    // Non-unique ID
    int nIndex = 0;
    String sNewID = sID + nIndex;
    do
    {
      if (m_aUsedIDs.add (sNewID))
      {
        // Now it's unique
        return sNewID;
      }
      ++nIndex;
      sNewID = sID + nIndex;
    } while (true);
  }
@Nullable
  public String getUniqueID (@Nullable final String sID)
  {
    if (sID == null)
      return null;

    if (m_aUsedIDs.add (sID))
    {
      // Unique ID
      return sID;
    }

    // Non-unique ID
    int nIndex = 0;
    String sNewID = sID + nIndex;
    do
    {
      if (m_aUsedIDs.add (sNewID))
      {
        // Now it's unique
        return sNewID;
      }
      ++nIndex;
      sNewID = sID + nIndex;
    } while (true);
  }
Create a unique ID based on the passed one. If the passed ID is not yet
contained, than a numeric index is appended until the ID is unique.

@param sID
The source ID. May be <code>null</code>.
@return <code>null</code> if the passed ID is <code>null</code> indicating
that no ID is present. Otherwise a unique ID is returned.