code: public boolean isFull() {
      return size() >= segment.descriptor().maxSegmentSize()
          || getNextIndex() - firstIndex >= segment.descriptor().maxEntries();
    }
docs: Returns a boolean indicating whether the segment is full.
  
  @return Indicates whether the segment is full.