class MultiBundleCSVFilter extends MultiBundleResourceFilter {

    @Override
    public Map<String, LanguageBundle> parse(InputStream inStream, FilterOptions options)
            throws IOException, ResourceFilterException {
        Map<String, LanguageBundleBuilder> builders = new HashMap<String, LanguageBundleBuilder>();
        CSVParser parser = CSVParser.parse(inStream, StandardCharsets.UTF_8,
                CSVFormat.RFC4180.withHeader("module", "key", "value").withSkipHeaderRecord(true));

        for (CSVRecord record : parser) {
            String bundle = record.get(0);
            String key = record.get(1);
            String value = record.get(2);

            LanguageBundleBuilder bundleBuilder = builders.get(bundle);
            if (bundleBuilder == null) {
                bundleBuilder = new LanguageBundleBuilder(true);
                builders.put(bundle, bundleBuilder);
            }
            bundleBuilder.addResourceString(key, value);
        }

        Map<String, LanguageBundle> result = new TreeMap<String, LanguageBundle>();
        for (Entry<String, LanguageBundleBuilder> bundleEntry : builders.entrySet()) {
            String bundleName = bundleEntry.getKey();
            LanguageBundle bundleData = bundleEntry.getValue().build();
            result.put(bundleName, bundleData);
        }

        return result;
    }

}