class AbstractFileServiceImpl implements AttributableFileService {

    List<Pair<String, String>> getFileAttributeFileNamesInternal(final Attributable attributable, final String lang, final String prefix) {

        final Collection<AttrValue> values = attributable.getAllAttributes();
        if (CollectionUtils.isEmpty(values)) {
            return Collections.singletonList(createNoDefaultFilePair(attributable));
        }
        final Map<String, Pair<String, String>> attrToFileMap = new TreeMap<>(); // sort naturally
        for (final AttrValue av : values) {
            final String code = av.getAttributeCode();
            if (code.startsWith(prefix) && StringUtils.isNotBlank(av.getVal())) {
                final String suffix = code.substring(prefix.length());
                final String key = suffix.length() == 1 || suffix.indexOf('_') == 1 ? "0" + suffix : suffix;
                if (code.endsWith(lang)) {
                    // put value for this language and remove possible default values
                    attrToFileMap.put(key, new Pair<>(code, av.getVal()));
                    attrToFileMap.remove(key.substring(0, key.length() - lang.length() - 1));
                } else {
                    final char lastChar = code.charAt(code.length() - 1);
                    if (lastChar >= '0' && lastChar <= '9' && !attrToFileMap.containsKey(key + "_" + lang)) {
                        // put default value only if we do not have language specific one
                        attrToFileMap.put(key, new Pair<>(code, av.getVal()));
                    }
                }
            }
        }

        if (attrToFileMap.isEmpty()) {
            return Collections.singletonList(createNoDefaultFilePair(attributable));
        }

        return Collections.unmodifiableList(new ArrayList<>(attrToFileMap.values()));
    }

      AbstractFileServiceImpl();
    protected  AbstractFileServiceImpl(final CacheManager cacheManager);

}