/* This string will work just fine as the fold is in the middle of a word */
final String correctNote = "Lines seem to be unfolded correctly if spaces aren't exactly on a folding boundary.";
VCard vcard = new VCardImpl();
vcard.setVersion(new VersionType(VCardVersion.V3_0));
vcard.setName(new NameType("Some Name"));
vcard.addNote(new NoteType(correctNote));
VCardWriter writer = new VCardWriter();
writer.setVCard(vcard);
String vcardString = writer.buildVCardString();
VCardEngine vcardEngine = new VCardEngine(CompatibilityMode.RFC2426);
VCard parsedVcard = vcardEngine.parse(vcardString);
assertNotNull(parsedVcard);
assertTrue(parsedVcard.hasNotes());
assertTrue(parsedVcard.getNotes().size() == 1);
String parsedNote = parsedVcard.getNotes().get(0).getNote();
assertEquals(correctNote, parsedNote);
//------------------------------------------------------
/* This string has the fold right at a space and the space is lost when retrieving it later */
final String incorrectNote = "Lines seem to be unfolded incorrectly if spaces are just exactly on a folding boundary.";
vcard = new VCardImpl();
vcard.setVersion(new VersionType(VCardVersion.V3_0));
vcard.setName(new NameType("Some Name"));
vcard.addNote(new NoteType(incorrectNote));
writer = new VCardWriter();
writer.setVCard(vcard);