text: public static string GetSegmentsFile(IList<string> files, bool allowEmpty){if (!files.Any()){if (allowEmpty)return null;throw new InvalidOperationException("empty list of files not allowed");}string segmentsFile = files.Last();files.RemoveAt(files.Count - 1);if (!segmentsFile.StartsWith(IndexFileNames.SEGMENTS, StringComparison.Ordinal) || segmentsFile.Equals(IndexFileNames.SEGMENTS_GEN, StringComparison.Ordinal)){throw new InvalidOperationException(string.Format("last file to copy+sync must be segments_N but got {0}; check your Revision implementation!", segmentsFile));}return segmentsFile;}