public static long getLastCommitGeneration(String[] files) {long max = -1;for (String file : files) {if (file.startsWith(IndexFileNames.SEGMENTS) &&file.startsWith(OLD_SEGMENTS_GEN) == false) {long gen = generationFromSegmentsFileName(file);if (gen > max) {max = gen;}}}return max;}

public static long GetLastCommitGeneration(string[] files){if (files == null){return -1;}long max = -1;foreach (var file in files){if (file.StartsWith(IndexFileNames.SEGMENTS, StringComparison.Ordinal) && !file.Equals(IndexFileNames.SEGMENTS_GEN, StringComparison.Ordinal)){long gen = GenerationFromSegmentsFileName(file);if (gen > max){max = gen;}}}return max;}
