POTResource extends ResourceFilter { @Override public void write(OutputStream outStream, LanguageBundle languageBundle, FilterOptions options) throws IOException, ResourceFilterException { BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outStream, CHAR_SET)); List<ResourceString> resStrings = languageBundle.getSortedResourceStrings(); BreakIterator brkItr = Utils.getWordBreakIterator(options); writer.write(getHeader()); for (ResourceString res : resStrings) { writer.newLine(); writer.write(formatMessage(UNTRANSLATED_STRING_PREFIX, res.getKey(), brkItr)); writer.write(TRANSLATED_STRING_PREFIX); writer.write("\"\""); writer.newLine(); } writer.flush(); }  @Override LanguageBundle parse(InputStream inStream, FilterOptions options); @Override void write(OutputStream outStream, LanguageBundle languageBundle,
            FilterOptions options); @Override void merge(InputStream baseStream, OutputStream outStream, LanguageBundle languageBundle,
            FilterOptions options);  }
@Test public void testWrite() throws IOException, ResourceFilterException { File tempFile = File.createTempFile(this.getClass().getSimpleName(), ".pot"); tempFile.deleteOnExit(); try (OutputStream os = new FileOutputStream(tempFile)) { res.write(os, WRITE_BUNDLE, null); os.flush(); assertTrue(ResourceTestUtil.compareFiles(EXPECTED_WRITE_FILE, tempFile, 19)); } }