code: public static int calculateCategoryIDs(DoubleLinkedPoiCategory rootNode, int maxValue) {
          int newMax = maxValue;
          for (PoiCategory c : rootNode.childCategories) {
              newMax = calculateCategoryIDs((DoubleLinkedPoiCategory) c, newMax);
          }
  
          rootNode.id = newMax;
  
          return newMax + 1;
      }
docs: This method calculates a unique ID for all nodes in the tree. For each node's 'n' ID named
  'ID_'n at depth 'd' the following invariants must be true:
  <ul>
  <li>ID > max(ID of all child nodes)</li>
  <li>All nodes' IDs left of n must be < ID_n.</li>
  <li>All nodes' IDs right of n must be > ID_n.</li>
  </ul>
  
  @param rootNode The tree's root node. (<strong>Any other node will result in invalid IDs!</strong>)
  @param maxValue Global maximum ID.
  @return The root node's ID.