docs: public String validateSegmentValue(String key, T1 value, int maximumNumber,
        int segmentNumber, boolean test) throws IOException {
      if (!closed) {
        if (segmentRegistration != null) {
          if (maximumNumber > 0) {
            T1 tmpSegmentValueMaxListMin = segmentValueTopListLast
                .get(segmentName);
            T1 tmpSegmentValueBoundary = segmentValuesBoundary.get(segmentName);
            if (segmentValueTopList.size() < maximumNumber) {
              if (!test) {
                segmentKeyValueList.get(segmentName).put(key, value);
                segmentValueTopList.add(value);
                segmentValueTopListLast.put(segmentName,
                    (tmpSegmentValueMaxListMin == null) ? value
                        : lastForComputingSegment(tmpSegmentValueMaxListMin,
                            value));
                if (segmentValueTopList.size() == maximumNumber) {
                  tmpSegmentValueMaxListMin = segmentValueTopListLast
                      .get(segmentName);
                  segmentValueTopListLast.put(segmentName,
                      tmpSegmentValueMaxListMin);
                  segmentValuesBoundary.put(segmentName,
                      boundaryForSegmentComputing(segmentName));
                }
              }
              return segmentKeys.contains(key) ? SEGMENT_KEY : SEGMENT_NEW;
            } else if (compareWithBoundary(value, tmpSegmentValueBoundary)) {
              // System.out.println(key+" "+value+" "+tmpSegmentValueBoundary);
              if (!test) {
                segmentKeyValueList.get(segmentName).put(key, value);
                if (compareWithBoundary(value, tmpSegmentValueMaxListMin)) {
                  segmentValueTopList.add(value);
                  segmentValueTopList.remove(tmpSegmentValueMaxListMin);
                  tmpSegmentValueMaxListMin = lastForComputingSegment();
                  segmentValueTopListLast.put(segmentName,
                      tmpSegmentValueMaxListMin);
                  segmentValuesBoundary.put(segmentName,
                      boundaryForSegmentComputing(segmentName));
                }
              }
              return segmentKeys.contains(key) ? SEGMENT_KEY : SEGMENT_NEW;
            } else if (segmentKeys.contains(key)) {
              if (!test) {
                segmentKeyValueList.get(segmentName).put(key, value);
              }
              return SEGMENT_KEY;
            } else {
              return null;
            }
          } else {
            return null;
          }
        } else {
          return null;
        }
      } else {
        throw new IOException("already closed");
      }
    }