code: public int getLastOrderNumber(NodeData parent) throws RepositoryException
     {
        int lastOrderNumber = changesLog.getLastChildOrderNumber(parent.getIdentifier());
        int lastPersistedNodeOrderNumber =
           isNew(parent.getIdentifier()) ? -1 : transactionableManager.getLastOrderNumber(parent);
  
        return Math.max(lastPersistedNodeOrderNumber, lastOrderNumber);
     }
docs: {@inheritDoc}