code: public int getListNumber(RtfList list) {
          if(lists.contains(list)) {
              return lists.indexOf(list);
          } else {
              lists.add(list);
              return lists.size();
          }
      }
docs: Gets the id of the specified RtfList. If the RtfList is not yet in the
  list of RtfList, then it is added.
  
  @param list The RtfList for which to get the id.
  @return The id of the RtfList.