code: public int normalizeStopTimesForPattern (int id, int beginWithSequence) throws SQLException {
          try {
              JDBCTableReader<PatternStop> patternStops = new JDBCTableReader(
                  Table.PATTERN_STOP,
                  dataSource,
                  tablePrefix + ".",
                  EntityPopulator.PATTERN_STOP
              );
              String patternId = getValueForId(id, "pattern_id", tablePrefix, Table.PATTERNS, connection);
              List<PatternStop> patternStopsToNormalize = new ArrayList<>();
              for (PatternStop patternStop : patternStops.getOrdered(patternId)) {
                  // Update stop times for any pattern stop with matching stop sequence (or for all pattern stops if the list
                  // is null).
                  if (patternStop.stop_sequence >= beginWithSequence) {
                      patternStopsToNormalize.add(patternStop);
                  }
              }
              int stopTimesUpdated = updateStopTimesForPatternStops(patternStopsToNormalize);
              connection.commit();
              return stopTimesUpdated;
          } catch (Exception e) {
              e.printStackTrace();
              throw e;
          } finally {
              DbUtils.closeQuietly(connection);
          }
      }
docs: For a given pattern id and starting stop sequence (inclusive), normalize all stop times to match the pattern
  stops' travel times.
  @return number of stop times updated