Got the solution.
First -> Never rely solely on logcat! The new line was ALWAYS there but logcat wasn't outputting it for some reason that I don't know yet.
Second -> JUnit was adding a [
, ]
, <
, >
and a new line
.
Solution: Remove all whitespaces and new lines from both strings and compare them.
final String vcardNoWhiteSpacesNoNewLinesExpected = vcardExpected.replace("\n", "").replace("\r", "").replace(" ", "");
final String vcardNoWhiteSpacesNoNewLinesActual = vcardActual.replace("\n", "").replace("\r", "").replace(" ", "");
They both match now, problem solved.