public class PoUtilityTest {
String lineSep = System.getProperty("line.separator");
@Test
public void testHeaderEntriesToString() throws Exception {
Properties entries = new Properties();
assertEquals("", PoUtility.propertiesToHeader(entries));
entries.setProperty("key", "value");
assertEquals("key=value" + lineSep,
PoUtility.propertiesToHeader(entries));
entries.setProperty("key2", "value2");
assertEquals("key=value" + lineSep + "key2=value2" + lineSep,
PoUtility.propertiesToHeader(entries));
entries.keySet().clear();
entries.setProperty("key with\na newline and spaces", "value");
assertEquals("key\\ with\\na\\ newline\\ and\\ spaces=value" + lineSep,
PoUtility.propertiesToHeader(entries));
}