<NME> LazyInitializedListTest.java
<BEF> package cgeo.geocaching.utils;

import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;

public class LazyInitializedListTest extends TestCase {
    public static void testAccess() {
        final LazyInitializedList<String> list = new LazyInitializedList<String>() {
            @Override
            protected List<String> loadFromDatabase() {
                return new ArrayList<String>();
            }
        };
        assertTrue(list.isEmpty());
        list.add("Test");
        assertFalse(list.isEmpty());
        list.add("Test");
        assertThat(list).isNotEmpty();
        assertThat(list).hasSize(1);
        int iterations = 0;
        for (final String element : list) {
        }
        assertEquals(1, iterations);
    }
}

<MSG> fix #2167: Not possible to open OP caches
<DFF> @@ -6,13 +6,16 @@ import java.util.List;
 import junit.framework.TestCase;
 
 public class LazyInitializedListTest extends TestCase {
+
+    private static final class MockedLazyInitializedList extends LazyInitializedList<String> {
+        @Override
+        protected List<String> loadFromDatabase() {
+            return new ArrayList<String>();
+        }
+    }
+
     public static void testAccess() {
-        final LazyInitializedList<String> list = new LazyInitializedList<String>() {
-            @Override
-            protected List<String> loadFromDatabase() {
-                return new ArrayList<String>();
-            }
-        };
+        final LazyInitializedList<String> list = new MockedLazyInitializedList();
         assertTrue(list.isEmpty());
         list.add("Test");
         assertFalse(list.isEmpty());
@@ -24,4 +27,21 @@ public class LazyInitializedListTest extends TestCase {
         }
         assertEquals(1, iterations);
     }
+
+    public static void testNull() {
+        final LazyInitializedList<String> list = new MockedLazyInitializedList();
+        list.set((LazyInitializedList<String>) null);
+        list.set((ArrayList<String>) null);
+    }
+
+    public static void testUnmodifiable() {
+        final MockedLazyInitializedList list = new MockedLazyInitializedList();
+        boolean unsupported = false;
+        try {
+            list.asList().add("this is not possible");
+        } catch (UnsupportedOperationException e) {
+            unsupported = true;
+        }
+        assertTrue(unsupported);
+    }
 }

fix #2167: Not possible to open OP caches