@Test public void testNoMatch(){ List<FakeComponentItem> fakes = asList(new FakeComponentItem(false), new FakeComponentItem(false)); ComponentItems<FakeComponentItem> component = new ComponentItems<>("component", Topology.DEFAULT_CONTEXT, fakes); Iterator<FakeComponentItem> iterator = component.iterator(); assertFalse(iterator.hasNext()); }
@Override public Iterator<I> iterator() { return stream(delegate.spliterator(), false) .filter(item -> item.belongsToComponent(component)) .filter(item -> item.belongsToContext(context)) .iterator(); }
ComponentItems implements Iterable<I> { @Override public Iterator<I> iterator() { return stream(delegate.spliterator(), false) .filter(item -> item.belongsToComponent(component)) .filter(item -> item.belongsToContext(context)) .iterator(); } }
ComponentItems implements Iterable<I> { @Override public Iterator<I> iterator() { return stream(delegate.spliterator(), false) .filter(item -> item.belongsToComponent(component)) .filter(item -> item.belongsToContext(context)) .iterator(); } ComponentItems(String component, String context, Iterable<I> delegate); }
ComponentItems implements Iterable<I> { @Override public Iterator<I> iterator() { return stream(delegate.spliterator(), false) .filter(item -> item.belongsToComponent(component)) .filter(item -> item.belongsToContext(context)) .iterator(); } ComponentItems(String component, String context, Iterable<I> delegate); @Override Iterator<I> iterator(); }
ComponentItems implements Iterable<I> { @Override public Iterator<I> iterator() { return stream(delegate.spliterator(), false) .filter(item -> item.belongsToComponent(component)) .filter(item -> item.belongsToContext(context)) .iterator(); } ComponentItems(String component, String context, Iterable<I> delegate); @Override Iterator<I> iterator();  }