private static void insertFileIntoStripe(ArrayList<HStoreFile> stripe, HStoreFile sf) {
    // The only operation for which sorting of the files matters is KeyBefore. Therefore,
    // we will store the file in reverse order by seqNum from the outset.
    for (int insertBefore = 0;; ++insertBefore) {
      if (
        insertBefore == stripe.size()
          || (StoreFileComparators.SEQ_ID.compare(sf, stripe.get(insertBefore)) >= 0)
      ) {
        stripe.add(insertBefore, sf);
        break;
      }
    }
  }
Inserts a file in the correct place (by seqnum) in a stripe copy.
@param stripe Stripe copy to insert into.
@param sf     File to insert.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/StripeStoreFileManager.java