### Question:
NavigationProviderImpl implements NavigationProvider { @Override public Navigation getNavigation() { Navigation navigation = new Navigation(); for (Class<?> annotatedClass : PAGES_WITH_NAVIGATION_ANNOTATION) { processNavigationItem(navigation, annotatedClass); } for (Class<?> enumAnnotatedClass : PAGES_WITH_ENUM_NAVIGATION_ANNOTATION) { processEnumNavigationItem(navigation, enumAnnotatedClass); } return navigation; } @Autowired  NavigationProviderImpl(ApplicationContext applicationContext,
                                  AuthenticationService authenticationService); @Override Navigation getNavigation(); @Override void setClassPathToScan(String classPathToScan); @SuppressWarnings("unchecked") // apache commons collection api does not support generics static Set<Class<? extends Page>> getAnnotatedWicketPage(String packageScanPath, Class<? extends Annotation> annotationClazz);  }### Answer:
@Test public void testGetNavigation() throws Exception { assertNotNull(navigation); assertEquals(2, navigation.getNavigationGroups().size()); }
@Test public void testRealNavigation() { ApplicationContextMock applicationContext = new ApplicationContextMock(); applicationContext.putBean("cart", mock(Cart.class)); applicationContext.putBean("authenticationService", mock(AuthenticationService.class)); NavigationProvider navigationProvider = new NavigationProviderImpl(applicationContext, authenticationService); Navigation realNavigation = navigationProvider.getNavigation(); assertNotNull(realNavigation); assertTrue("Main Navigation must not empty", !realNavigation.getMainNavigationGroup().getNavigationEntries().isEmpty()); }