AbstractRouteRegistryInitializer implements Serializable { @SuppressWarnings("unchecked") protected Set<Class<? extends Component>> validateRouteClasses( Stream<Class<?>> routeClasses) { return routeClasses.peek(this::checkForConflictingAnnotations) .filter(this::isApplicableClass) .map(target -> (Class<? extends Component>) target) .collect(Collectors.toSet()); }    }
@Test(expected = InvalidRouteLayoutConfigurationException.class) public void routeAndParentLayout_notRouterLayout_throws() { initializer.validateRouteClasses(Stream.of(RouteAndParentLayout.class)); }
@Test public void routeAndParentLayout_routerLayout_returnsValidatedClass() { Set<Class<? extends Component>> classes = initializer .validateRouteClasses( Stream.of(RouteAndParentRouterLayout.class)); Assert.assertEquals(1, classes.size()); Assert.assertEquals(RouteAndParentRouterLayout.class, classes.iterator().next()); }