### Question:
ParagraphNumberValidator extends Validator { @Override public void validate(Section section) { int paragraphNumber = section.getNumberOfParagraphs(); if (getInt("max_num") < paragraphNumber) { addLocalizedError(section.getJoinedHeaderContents(), getInt("max_num")); } } ParagraphNumberValidator(); @Override void validate(Section section);  }### Answer:
@Test void testSectionWithManySection() { Section section = new Section(0, "header"); section.appendParagraph(new Paragraph()); section.appendParagraph(new Paragraph()); section.appendParagraph(new Paragraph()); section.appendParagraph(new Paragraph()); List<ValidationError> errors = new ArrayList<>(); validator.setErrorList(errors); validator.validate(section); assertEquals(1, errors.size()); }
@Test void testSectionWithOnlyOneSection() { Section section = new Section(0); section.appendParagraph(new Paragraph()); List<ValidationError> errors = new ArrayList<>(); validator.setErrorList(errors); validator.validate(section); assertEquals(0, errors.size()); }