code: public String validateSegmentValue(T1 value, int maximumNumber,
        int segmentNumber) throws IOException {
      if (!closed) {
        if (segmentRegistration != null) {
          if (maximumNumber > 0) {
            T1 tmpSegmentValueBoundary = segmentValuesBoundary.get(segmentName);
            if (segmentValueTopList.size() < maximumNumber
                || compareWithBoundary(value, tmpSegmentValueBoundary)) {
              return SEGMENT_KEY_OR_NEW;
            } else if (segmentKeys.size() > newKnownKeyFoundInSegment.size()) {
              return SEGMENT_POSSIBLE_KEY;
            } else {
              return null;
            }
          } else {
            return null;
          }
        } else {
          return null;
        }
      } else {
        throw new IOException("already closed");
      }
    }
docs: Validate segment value.
  
  @param value the value
  @param maximumNumber the maximum number
  @param segmentNumber the segment number
  @return the string
  @throws IOException Signals that an I/O exception has occurred.