<NME> PersonalNoteTest.java
<BEF> package cgeo.geocaching.models;

import org.junit.Test;
import static org.assertj.core.api.Java6Assertions.assertThat;

public class PersonalNoteTest {

    @Test
    public void testNewestLocalAlwaysPreserved() {
        PersonalNote note = createNote("local note", false);
        note.gatherMissingDataFrom(createNote("provider note", true));
        assertThat(note.getNote()).contains("local note");


        note = createNote("local note", false);
        note.gatherMissingDataFrom(createNote("local2 note", false));
        assertThat(note.getNote()).contains("local note");
        assertThat(note.getNote()).doesNotContain("local2 note");

        note = createNote("provider note", true);
        note.gatherMissingDataFrom(createNote("local note", false));
        assertThat(note.getNote()).contains("local note");

        note = createNote("provider note", true);
        note.gatherMissingDataFrom(createNote("provider2 note", true));
        assertThat(note.getNote()).contains("provider note");
        assertThat(note.getNote()).doesNotContain("provider2 note");
    }

    @Test
    public void testPreserveProviderNote() {
        final PersonalNote note = createNote("provider note", true);
        note.gatherMissingDataFrom(createNote("local note", false));
        assertThat(note.getNote()).contains("provider note");
    }

        PersonalNote parsedNote = new PersonalNote(truncCache);

        Geocache exceedingCache = new Geocache();
        exceedingCache.setListId(StoredList.STANDARD_LIST_ID); // stored
        exceedingCache.setPersonalNote(testString);
        PersonalNote otherNote = new PersonalNote(exceedingCache);
        PersonalNote result = parsedNote.mergeWith(otherNote);
    private static PersonalNote createNote(final String text, final boolean isFromProvider) {
        final PersonalNote note = new PersonalNote();
        note.setNote(text);
        note.setFromProvider(isFromProvider);
        return note;
    }

}
        cache1.setPersonalNote("Simple cgeo note\n--\nSimple provider note");
        PersonalNote myNote = new PersonalNote(cache1);
        Geocache cache2 = new Geocache();
        cache2.setListId(StoredList.STANDARD_LIST_ID); // stored
        cache2.setPersonalNote("cgeo note\n--\nProvider note");
        PersonalNote otherNote = new PersonalNote(cache2);
        PersonalNote result = myNote.mergeWith(otherNote);
        cache1.setPersonalNote("Simple cgeo note\n--\nSimple provider note");
        PersonalNote myNote = new PersonalNote(cache1);
        Geocache cache2 = new Geocache();
        cache2.setListId(StoredList.STANDARD_LIST_ID); // stored
        cache2.setPersonalNote("Provider note");
        PersonalNote otherNote = new PersonalNote(cache2);
        PersonalNote result = myNote.mergeWith(otherNote);

<MSG> Merge pull request #5521 from pstorch/fix_87

Fix #87: store caches on multiple lists
<DFF> @@ -37,7 +37,7 @@ public class PersonalNoteTest extends TestCase {
         PersonalNote parsedNote = new PersonalNote(truncCache);
 
         Geocache exceedingCache = new Geocache();
-        exceedingCache.setListId(StoredList.STANDARD_LIST_ID); // stored
+        exceedingCache.getLists().add(StoredList.STANDARD_LIST_ID); // stored
         exceedingCache.setPersonalNote(testString);
         PersonalNote otherNote = new PersonalNote(exceedingCache);
         PersonalNote result = parsedNote.mergeWith(otherNote);
@@ -58,7 +58,7 @@ public class PersonalNoteTest extends TestCase {
         cache1.setPersonalNote("Simple cgeo note\n--\nSimple provider note");
         PersonalNote myNote = new PersonalNote(cache1);
         Geocache cache2 = new Geocache();
-        cache2.setListId(StoredList.STANDARD_LIST_ID); // stored
+        cache2.getLists().add(StoredList.STANDARD_LIST_ID); // stored
         cache2.setPersonalNote("cgeo note\n--\nProvider note");
         PersonalNote otherNote = new PersonalNote(cache2);
         PersonalNote result = myNote.mergeWith(otherNote);
@@ -71,7 +71,7 @@ public class PersonalNoteTest extends TestCase {
         cache1.setPersonalNote("Simple cgeo note\n--\nSimple provider note");
         PersonalNote myNote = new PersonalNote(cache1);
         Geocache cache2 = new Geocache();
-        cache2.setListId(StoredList.STANDARD_LIST_ID); // stored
+        cache2.getLists().add(StoredList.STANDARD_LIST_ID); // stored
         cache2.setPersonalNote("Provider note");
         PersonalNote otherNote = new PersonalNote(cache2);
         PersonalNote result = myNote.mergeWith(otherNote);

Merge pull request #5521 from pstorch/fix_87