@Test public void listAllVisibilityOptionsWithNoComponentsReturnsEmptyList() throws ComponentLookupException { when(this.componentManager.<Visibility>getInstanceList(Visibility.class)).thenReturn(Collections.emptyList()); Collection<Visibility> returnedVisibilities = this.component.listAllVisibilityOptions(); Assert.assertTrue(returnedVisibilities.isEmpty()); }
@Nonnull @Override public Collection<Visibility> listAllVisibilityOptions() { try { return new TreeSet<>(this.componentManager.get().getInstanceList(Visibility.class)); } catch (final ComponentLookupException ex) { return Collections.emptyList(); } }
DefaultEntityVisibilityManager implements EntityVisibilityManager { @Nonnull @Override public Collection<Visibility> listAllVisibilityOptions() { try { return new TreeSet<>(this.componentManager.get().getInstanceList(Visibility.class)); } catch (final ComponentLookupException ex) { return Collections.emptyList(); } } }
DefaultEntityVisibilityManager implements EntityVisibilityManager { @Nonnull @Override public Collection<Visibility> listAllVisibilityOptions() { try { return new TreeSet<>(this.componentManager.get().getInstanceList(Visibility.class)); } catch (final ComponentLookupException ex) { return Collections.emptyList(); } }  }
DefaultEntityVisibilityManager implements EntityVisibilityManager { @Nonnull @Override public Collection<Visibility> listAllVisibilityOptions() { try { return new TreeSet<>(this.componentManager.get().getInstanceList(Visibility.class)); } catch (final ComponentLookupException ex) { return Collections.emptyList(); } }  @Nonnull @Override Collection<Visibility> listVisibilityOptions(); @Nonnull @Override Collection<Visibility> listAllVisibilityOptions(); @Nonnull @Override Visibility getDefaultVisibility(); @Nonnull @Override Visibility resolveVisibility(@Nullable final String name); @Override boolean setVisibility(
        @Nullable final PrimaryEntity entity,
        @Nullable final Visibility visibility); @Nonnull @Override Visibility getVisibility(@Nullable final PrimaryEntity entity); @Nonnull @Override Collection<? extends PrimaryEntity> filterByVisibility(
        @Nullable final Collection<? extends PrimaryEntity> entities,
        @Nullable final Visibility requiredVisibility); @Nonnull @Override Iterator<? extends PrimaryEntity> filterByVisibility(
        @Nullable final Iterator<? extends PrimaryEntity> entities,
        @Nullable final Visibility requiredVisibility); }
DefaultEntityVisibilityManager implements EntityVisibilityManager { @Nonnull @Override public Collection<Visibility> listAllVisibilityOptions() { try { return new TreeSet<>(this.componentManager.get().getInstanceList(Visibility.class)); } catch (final ComponentLookupException ex) { return Collections.emptyList(); } }  @Nonnull @Override Collection<Visibility> listVisibilityOptions(); @Nonnull @Override Collection<Visibility> listAllVisibilityOptions(); @Nonnull @Override Visibility getDefaultVisibility(); @Nonnull @Override Visibility resolveVisibility(@Nullable final String name); @Override boolean setVisibility(
        @Nullable final PrimaryEntity entity,
        @Nullable final Visibility visibility); @Nonnull @Override Visibility getVisibility(@Nullable final PrimaryEntity entity); @Nonnull @Override Collection<? extends PrimaryEntity> filterByVisibility(
        @Nullable final Collection<? extends PrimaryEntity> entities,
        @Nullable final Visibility requiredVisibility); @Nonnull @Override Iterator<? extends PrimaryEntity> filterByVisibility(
        @Nullable final Iterator<? extends PrimaryEntity> entities,
        @Nullable final Visibility requiredVisibility);  }