void () { String text = "V1=single line\0V2=multiple\nlines\0V3=single line\0PWD=?\0"; Map<String, String> map = EnvironmentUtil.testParser(text); assertEquals("single line", map.get("V1")); assertEquals("multiple\nlines", map.get("V2")); assertEquals("single line", map.get("V3")); if (System.getenv().containsKey("PWD")) { assertEquals(System.getenv("PWD"), map.get("PWD")); assertEquals(4, map.size()); } else { assertEquals(3, map.size()); } }