@Test public void testGetItems() { final String s1 = "an string 1"; final String s2 = "an string 2"; tested = new MapRegistry<Object>(keyProvider, new HashMap<String, Object>(2) {{ put(s1, s1); put(s2, 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()); }
public Collection<T> getItems() { return Collections.unmodifiableList(new ArrayList<T>(items.values())); }
MapRegistry implements DynamicRegistry<T> { public Collection<T> getItems() { return Collections.unmodifiableList(new ArrayList<T>(items.values())); } }
MapRegistry implements DynamicRegistry<T> { public Collection<T> getItems() { return Collections.unmodifiableList(new ArrayList<T>(items.values())); } MapRegistry(final KeyProvider<T> keyProvider,
                final Map<String, T> items); }
MapRegistry implements DynamicRegistry<T> { public Collection<T> getItems() { return Collections.unmodifiableList(new ArrayList<T>(items.values())); } MapRegistry(final KeyProvider<T> keyProvider,
                final Map<String, T> items); @Override void register(final T item); boolean remove(final T item); @Override boolean contains(final T item); @Override boolean isEmpty(); Collection<T> getItems(); void clear(); T getItemByKey(final String key); }
MapRegistry implements DynamicRegistry<T> { public Collection<T> getItems() { return Collections.unmodifiableList(new ArrayList<T>(items.values())); } MapRegistry(final KeyProvider<T> keyProvider,
                final Map<String, T> items); @Override void register(final T item); boolean remove(final T item); @Override boolean contains(final T item); @Override boolean isEmpty(); Collection<T> getItems(); void clear(); T getItemByKey(final String key);  }