code: public static EpochTransitionRecord computeEpochTransition(EpochRecord currentEpoch, List<Long> segmentsToSeal,
                                                                 List<Map.Entry<Double, Double>> newRanges, long scaleTimestamp) {
          Preconditions.checkState(segmentsToSeal.stream().allMatch(currentEpoch::containsSegment), "Invalid epoch transition request");
  
          int newEpoch = currentEpoch.getEpoch() + 1;
          int nextSegmentNumber = currentEpoch.getSegments().stream().mapToInt(StreamSegmentRecord::getSegmentNumber).max().getAsInt() + 1;
          ImmutableMap.Builder<Long, Map.Entry<Double, Double>> newSegments = ImmutableMap.builder();
          for (int i = 0; i < newRanges.size(); i++) {
              newSegments.put(computeSegmentId(nextSegmentNumber + i, newEpoch), newRanges.get(i));
          }
          return new EpochTransitionRecord(currentEpoch.getEpoch(), scaleTimestamp, ImmutableSet.copyOf(segmentsToSeal), 
                  newSegments.build());
  
      }
docs: Method to compute epoch transition record. It takes segments to seal and new ranges and all the tables and
  computes the next epoch transition record.
  @param currentEpoch current epoch record
  @param segmentsToSeal segments to seal
  @param newRanges new ranges
  @param scaleTimestamp scale time
  @return new epoch transition record based on supplied input