@Test
public void testWrite() throws IOException, ResourceFilterException {

    File tempFile = File.createTempFile(this.getClass().getSimpleName(), ".properties");
    tempFile.deleteOnExit();
    try (OutputStream os = new FileOutputStream(tempFile)) {
        res.write(os, WRITE_BUNDLE, null);
        os.flush();
        // Properties.store() puts a comment with date and time
        // on the first line, ignore it by passing n=1 to compareFiles()
        assertTrue(ResourceTestUtil.compareFilesUpTo(EXPECTED_WRITE_FILE, tempFile, 5));
        assertTrue(ResourceTestUtil.compareFiles(EXPECTED_WRITE_FILE, tempFile, 6));
    }
}