OnboardingManagerImpl extends ComponentSupport implements OnboardingManager { @Override public List<OnboardingItem> getOnboardingItems() { if (onboardingConfiguration.isEnabled()) { return onboardingItems.stream().filter(OnboardingItem::applies) .sorted(Comparator.comparingInt(OnboardingItem::getPriority)).collect(Collectors.toList()); } return Collections.emptyList(); } @Inject  OnboardingManagerImpl(final Set<OnboardingItem> onboardingItems,
                               final OnboardingConfiguration onboardingConfiguration); @Override boolean needsOnboarding(); @Override List<OnboardingItem> getOnboardingItems();  }
@Test public void testGetOnboardingItems() { List<OnboardingItem> items = underTest.getOnboardingItems(); assertThat(items.size(), is(3)); assertThat(items.get(0).getType(), is("type3")); assertThat(items.get(1).getType(), is("type2")); assertThat(items.get(2).getType(), is("type1")); }
@Test public void testGetOnboardingItems_noItems() { underTest = new OnboardingManagerImpl(Collections.emptySet(), onboardingConfiguration); assertThat(underTest.getOnboardingItems().size(), is(0)); }