code: public static boolean validateInputRange(final List<Long> segmentsToSeal,
                                               final List<Map.Entry<Double, Double>> newRanges,
                                               final EpochRecord currentEpoch) {
          boolean newRangesCheck = newRanges.stream().noneMatch(x -> x.getKey() >= x.getValue() && x.getValue() > 0);
  
          if (newRangesCheck) {
              List<Map.Entry<Double, Double>> oldRanges = segmentsToSeal.stream()
                      .map(segmentId -> {
                          StreamSegmentRecord segment = currentEpoch.getSegment(segmentId);
                          if (segment != null) {
                              return new AbstractMap.SimpleEntry<>(segment.getKeyStart(), segment.getKeyEnd());
                          } else {
                              return null;
                          }
                      }).filter(Objects::nonNull)
                      .collect(Collectors.toList());
              return reduce(oldRanges).equals(reduce(newRanges));
          }
          
          return false;
      }
docs: Method to validate supplied scale input. It performs a check that new ranges are identical to sealed ranges.
  
  @param segmentsToSeal segments to seal
  @param newRanges      new ranges to create
  @param currentEpoch   current epoch record
  @return true if scale input is valid, false otherwise.