code: protected ItemState findLastItemState(QPath itemPath)
     {
        for (int i = itemAddStates.size() - 1; i >= 0; i--)
        {
           ItemState istate = itemAddStates.get(i);
           if (istate.getData().getQPath().equals(itemPath))
              return istate;
        }
        return null;
     }
docs: Find last ItemState.
  
  @param itemPath item path
  @return ItemState