@Test
public void testMerge() {

    String[] baseLines = {
            "key,value",
            "spaghetti,Spaghetti",
            "minestrone,Minestrone",
            "pizza,Pizza"
    };
    TestResourceStringData[] testData = {
            new TestResourceStringData("pizza", "ピザ", 1),
            new TestResourceStringData("spaghetti", "スパゲッティ", 2),
            new TestResourceStringData("calzone", "カルゾーン", 3)
    };
    String[] expectedLines = {
            "key,value",
            "spaghetti,スパゲッティ",
            "minestrone,Minestrone",
            "pizza,ピザ"
    };
    LanguageBundle bundle = TestUtils.createLanguageBundle(testData);
    ResourceFilter filter = ResourceFilterFactory.getResourceFilter(CSVFilter.ID);
    try (InputStream baseStream = TestUtils.creteInputStream(baseLines);
            ByteArrayOutputStream outStream = new ByteArrayOutputStream()) {
        filter.merge(baseStream, outStream, bundle, new FilterOptions(Locale.JAPANESE));
        TestUtils.compareLines(expectedLines, outStream.toByteArray());
    } catch (IOException e) {
        fail(e.getMessage());
    } catch (ResourceFilterException e) {
        fail(e.getMessage());
    }
}