text: public static String getSegmentsFile(List<String> files, boolean allowEmpty) {if (files.isEmpty()) {if (allowEmpty) {return null;} else {throw new IllegalStateException("empty list of files not allowed");}}String segmentsFile = files.remove(files.size() - 1);if (!segmentsFile.startsWith(IndexFileNames.SEGMENTS)) {throw new IllegalStateException("last file to copy+sync must be segments_N but got " + segmentsFile+ "; check your Revision implementation!");}return segmentsFile;}