@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()); }
@Override public void validate(Section section) { int paragraphNumber = section.getNumberOfParagraphs(); if (getInt("max_num") < paragraphNumber) { addLocalizedError(section.getJoinedHeaderContents(), getInt("max_num")); } }
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 extends Validator { @Override public void validate(Section section) { int paragraphNumber = section.getNumberOfParagraphs(); if (getInt("max_num") < paragraphNumber) { addLocalizedError(section.getJoinedHeaderContents(), getInt("max_num")); } } ParagraphNumberValidator(); }
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); }
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);  }