TestValidationListener validationListener = new TestValidationListener();
List<PageSection> pageSections = pageSpec.getSections();
assertThat("Filtered sections size should be", pageSections.size(), is(1));
SectionFilter sectionFilter = new SectionFilter(asList("all", "mobile"), asList("nomobile"));
SectionValidation sectionValidation = new SectionValidation(pageSections, new PageValidation(null, page, pageSpec, validationListener, sectionFilter), validationListener);
List<ValidationError> errors = sectionValidation.check();
assertLines(validationListener.getInvokations(), lines(