### Question:
Document implements Iterable<Section>, Serializable { public static DocumentBuilder builder() { return new DocumentBuilder(); } Document(List<Section> sections, Optional<String> fileName, Set<PreprocessorRule> preprocessorRules); Section getLastSection(); int size(); Section getSection(int id); Optional<String> getFileName(); @Override Iterator<Section> iterator(); @Override boolean equals(Object o); Set<PreprocessorRule> getPreprocessorRules(); @Override int hashCode(); @Override String toString(); static DocumentBuilder builder(); static DocumentBuilder builder(RedPenTokenizer tokenizer);  }### Answer:
@Test void testCreateListBlockBeforeSection() { assertThrows(IllegalStateException.class, ()->{ Document.builder() .setFileName("Foobar") .addListBlock() .addSection(0) .build(); }); }
@Test void testCreateListElementBeforeListBlock() { assertThrows(IllegalStateException.class, ()-> { Document.builder() .setFileName("Foobar") .addListElement(0, "foo") .addListBlock() .build(); }); }