I\'m using Intellij IDEA 14 on Windows and Git as VCS on Unix server.
The line separator in Windows is CLRF (\\r\\n) and LF (\\n) in Unix.
In Git, I\'m
If you came to this thread like me seeking an answer as to why your unit test (JUnit) fails on comparing generated JSON (or any other structure that contains line separators) with one written by hand, you should replace \n by \r\n (for Windows) in your string. The instructions given above don't work for this case.
UPD.