    @Test
    public void testCollapseLineBreaks() {

        Assert.assertNull(StringUtils.collapseLineBreaks(null));
        Assert.assertEquals("", StringUtils.collapseLineBreaks(""));
        Assert.assertEquals("foobar", StringUtils.collapseLineBreaks("foobar"));
        Assert.assertEquals("foo bar", StringUtils.collapseLineBreaks("foo bar"));
        Assert.assertEquals("foobar", StringUtils.collapseLineBreaks("foo\nbar"));
        Assert.assertEquals("foobar", StringUtils.collapseLineBreaks("foo\n\nbar"));
        Assert.assertEquals("foobar", StringUtils.collapseLineBreaks("foo\rbar"));
        Assert.assertEquals("foobar", StringUtils.collapseLineBreaks("foo\r\nbar"));
        Assert.assertEquals("foobar", StringUtils.collapseLineBreaks("foo\r\nbar\n"));
        Assert.assertEquals("foobar", StringUtils.collapseLineBreaks("\rfoo\nbar"));
        Assert.assertEquals("foo bar", StringUtils.collapseLineBreaks("\rfoo bar\n"));
    }