code: int assignPosition(Id id) throws RepositoryException {
  
          int pos = -1;
          if (!freePositions.isEmpty()) {
              pos = freePositions.remove(0);
          } else {
              pos = nextPos++;
              ensureCapacity(pos);
          }
  
          idPosMap.put(id, pos);
  
          for (HierarchicalTypeStore s : superTypeStores) {
              s.assignPosition(id);
          }
  
          return pos;
      }
docs: Assign a storage position to an Id.
  - try to assign from freePositions
  - ensure storage capacity.
  - add entry in idPosMap.
  @param id
  @return
  @throws RepositoryException