text: public static String fileNameFromGeneration(String base, String ext, long gen) {if (gen == -1) {return null;} else if (gen == 0) {return segmentFileName(base, "", ext);} else {assert gen > 0;StringBuilder res = new StringBuilder(base.length() + 6 + ext.length()).append(base).append('_').append(Long.toString(gen, Character.MAX_RADIX));if (ext.length() > 0) {res.append('.').append(ext);}return res.toString();}}