OrderedProperties { public String asPairsWithComment(String comment) { return new PropertiesWriter(pairs).writeString(comment); }  OrderedProperties filter(Predicate<String> filter); OrderedProperties addMapPairs(Map<String, String> additionalPairs); OrderedProperties addIterablePairs(Iterable<? extends Map.Entry<String, ?>> iterable); OrderedProperties addStringPairs(String keyValuePairs); OrderedProperties addStringPairs(InputStream is); OrderedProperties addPair(String key, String value); String asPairs(); String asPairsWithComment(String comment); Map<String, String> asMap(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void pairsWithComment() { assertThat(createTestKeyValues().asPairsWithComment("this is a comment"), is("# this is a comment\n" + "first=1\n" + "second=2\n" + "third=3\n" + "FOURTH=4\n")); }
@Test public void pairsWithMultineComment() { assertThat(new OrderedProperties().asPairsWithComment("this\nis\n\ra\rcomment\\"), is("# this\n" + "# is\n" + "# a\n" + "# comment\\\n")); }