Rather than hard-coding assumptions about the line endings, use a PrintWriter to produce the multi-line expected output