code: public int getLast()
    {
      if (isEmpty()) {
        return -1;
      }
  
      int last = 0;
      for (int i = 0; i <= lastWordIndex; i++) {
        int w = words.get(i);
        if (ConciseSetUtils.isLiteral(w)) {
          last += ConciseSetUtils.MAX_LITERAL_LENGTH;
        } else {
          last += ConciseSetUtils.maxLiteralLengthMultiplication(ConciseSetUtils.getSequenceCount(w) + 1);
        }
      }
  
      int w = words.get(lastWordIndex);
      if (ConciseSetUtils.isLiteral(w)) {
        last -= Integer.numberOfLeadingZeros(ConciseSetUtils.getLiteralBits(w));
      } else {
        last--;
      }
      return last;
    }
docs: Based on the ConciseSet implementation by Alessandro Colantonio