String (final Collection<? extends PropertiesFile> files) { String commonPrefix = null; for (PropertiesFile file : files) { final String baseName = file.getVirtualFile().getNameWithoutExtension(); if (commonPrefix == null) { commonPrefix = baseName; } else { commonPrefix = StringUtil.commonPrefix(commonPrefix, baseName); if (commonPrefix.isEmpty()) { break; } } } assert commonPrefix != null; if (!commonPrefix.isEmpty() && BASE_NAME_BORDER_CHAR.contains(commonPrefix.charAt(commonPrefix.length() - 1))) { commonPrefix = commonPrefix.substring(0, commonPrefix.length() - 1); } return commonPrefix; }