@Test
public void testReaderToStringXMLEncodeWithEndOfLineString() throws Exception {

    Reader r = new StringReader("<root> \n" +
            "    <name>GeeksforGeeks</name> \n" +
            "    <address> \n" +
            "        <sector>142</sector> \n" +
            "        <location>Noida</location> \n" +
            "    </address> \n" +
            "</root> r");
    String s = Misc.readerToString(r, "23", true);
    assertEquals("&lt;root&gt; 23    &lt;name&gt;GeeksforGeeks&lt;/name&gt; 23    &lt;address&gt; 23        &lt;sector&gt;142&lt;/sector&gt; 23        &lt;location&gt;Noida&lt;/location&gt; 23    &lt;/address&gt; 23&lt;/root&gt; r", s);
}