@Test
public void testMerge() {

    String[] baseLines = {
            "module,key,value",
            "Japanese Foods,ramen,Ramen",
            "Italian Foods,minestrone,Minestrone",
            "Japanese Foods,sushi,Sushi",
            "Italian Foods,pizza,Pizza",
            "Italian Foods,spaghetti,Spaghetti"
    };
    TestResourceStringData[] testDataJapanese = {
            new TestResourceStringData("sushi", "寿司", 1),
            new TestResourceStringData("ramen", "ラーメン", 2),
            new TestResourceStringData("tempura", "天ぷら", 3)
    };
    TestResourceStringData[] testDataItalian = {
            new TestResourceStringData("spaghetti", "スパゲッティ", 1),
            new TestResourceStringData("pizza", "ピザ", 2)
    };
    String[] expectedLines = {
            "module,key,value",
            "Japanese Foods,ramen,ラーメン",
            "Italian Foods,minestrone,Minestrone",
            "Japanese Foods,sushi,寿司",
            "Italian Foods,pizza,ピザ",
            "Italian Foods,spaghetti,スパゲッティ"
    };
    Map<String, LanguageBundle> testDataMap = new LinkedHashMap<>();
    testDataMap.put("Japanese Foods", TestUtils.createLanguageBundle(testDataJapanese));
    testDataMap.put("Italian Foods", TestUtils.createLanguageBundle(testDataItalian));
    MultiBundleResourceFilter filter = ResourceFilterFactory.getMultiBundleResourceFilter(MultiBundleCSVFilter.ID);
    try (InputStream baseStream = TestUtils.creteInputStream(baseLines);
            ByteArrayOutputStream outStream = new ByteArrayOutputStream()) {
        filter.merge(baseStream, outStream, testDataMap, new FilterOptions(Locale.JAPANESE));
        TestUtils.compareLines(expectedLines, outStream.toByteArray());
    } catch (IOException e) {
        fail(e.getMessage());
    } catch (ResourceFilterException e) {
        fail(e.getMessage());
    }
}