@Test public void shouldReturnEmptyIteratorIfOneElementWasDetached() throws Exception { final BackendProviderSet traceeBackendProviders = buildProviderSetWithOneDetachedProvider(); assertThat(traceeBackendProviders.iterator().hasNext(), equalTo(false)); }
@Override public Iterator<TraceeBackendProvider> iterator() { final Collection<TraceeBackendProvider> strongRefList = createStrongView(values); determineValidity(strongRefList); if (valid) { return strongRefList.iterator(); } return Collections.<TraceeBackendProvider>emptyList().iterator(); }
BackendProviderSet extends AbstractSet<TraceeBackendProvider> { @Override public Iterator<TraceeBackendProvider> iterator() { final Collection<TraceeBackendProvider> strongRefList = createStrongView(values); determineValidity(strongRefList); if (valid) { return strongRefList.iterator(); } return Collections.<TraceeBackendProvider>emptyList().iterator(); } }
BackendProviderSet extends AbstractSet<TraceeBackendProvider> { @Override public Iterator<TraceeBackendProvider> iterator() { final Collection<TraceeBackendProvider> strongRefList = createStrongView(values); determineValidity(strongRefList); if (valid) { return strongRefList.iterator(); } return Collections.<TraceeBackendProvider>emptyList().iterator(); } BackendProviderSet(Set<TraceeBackendProvider> elements); }
BackendProviderSet extends AbstractSet<TraceeBackendProvider> { @Override public Iterator<TraceeBackendProvider> iterator() { final Collection<TraceeBackendProvider> strongRefList = createStrongView(values); determineValidity(strongRefList); if (valid) { return strongRefList.iterator(); } return Collections.<TraceeBackendProvider>emptyList().iterator(); } BackendProviderSet(Set<TraceeBackendProvider> elements); @Override Iterator<TraceeBackendProvider> iterator(); @Override int size(); }
BackendProviderSet extends AbstractSet<TraceeBackendProvider> { @Override public Iterator<TraceeBackendProvider> iterator() { final Collection<TraceeBackendProvider> strongRefList = createStrongView(values); determineValidity(strongRefList); if (valid) { return strongRefList.iterator(); } return Collections.<TraceeBackendProvider>emptyList().iterator(); } BackendProviderSet(Set<TraceeBackendProvider> elements); @Override Iterator<TraceeBackendProvider> iterator(); @Override int size();  }