### Question:
ListRegistry implements DynamicRegistry<T> { public Collection<T> getItems() { return Collections.unmodifiableList(items); } ListRegistry(final KeyProvider<T> keyProvider,
                        final List<T> items); void add(final int pos,
                    final T item); @Override void register(final T item); boolean remove(final T item); @Override boolean contains(final T item); @Override boolean isEmpty(); Collection<T> getItems(); T getItemByKey(final String id); void clear(); int indexOf(final T item);  }### Answer:
@Test public void testGetItems() { final String s1 = "an string 1"; final String s2 = "an string 2"; tested = new ListRegistry<>(keyProvider, new ArrayList<Object>(2) {{ add(s1); add(s2); }}); Collection<Object> items = tested.getItems(); assertNotNull(items); assertEquals(2, items.size()); Iterator<Object> it = items.iterator(); assertEquals(s1, it.next()); assertEquals(s2, it.next()); }