### Question:
ReadOnlyStyledDocumentBuilder { public ReadOnlyStyledDocument<PS, SEG, S> build() { ensureNotYetCreated(); if (paragraphList.isEmpty()) { throw new IllegalStateException("Cannot build a ReadOnlyStyledDocument with an empty list of paragraphs!"); } alreadyCreated = true; return new ReadOnlyStyledDocument<>(paragraphList); } ReadOnlyStyledDocumentBuilder(SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle);  ReadOnlyStyledDocumentBuilder(SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle, int initialCapacity); private  ReadOnlyStyledDocumentBuilder(SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle, List<Paragraph<PS, SEG, S>> list); static ReadOnlyStyledDocument<PS, SEG, S> constructDocument(
            SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle,
            Consumer<ReadOnlyStyledDocumentBuilder<PS, SEG, S>> configuration); static ReadOnlyStyledDocument<PS, SEG, S> constructDocument(
            SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle,
            int initialCapacity, Consumer<ReadOnlyStyledDocumentBuilder<PS, SEG, S>> configuration); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(List<StyledSegment<SEG, S>> styledSegments); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(List<StyledSegment<SEG, S>> styledSegments, PS paragraphStyle); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(SEG segment, S style); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(SEG segment, S style, PS paragraphStyle); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(SEG segment, StyleSpans<S> styles); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(SEG segment, StyleSpans<S> styles, PS paragraphStyle); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(List<SEG> segments, StyleSpans<S> styles); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraph(List<SEG> segments, StyleSpans<S> styles, PS paragraphStyle); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraphs(List<List<SEG>> listOfSegLists,
                                 StyleSpans<S> entireDocumentStyleSpans); ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraphs0(List<Tuple2<PS, List<SEG>>> paragraphArgList,
                                 StyleSpans<S> entireDocumentStyleSpans); ReadOnlyStyledDocument<PS, SEG, S> build();  }### Answer:
@Test public void attempting_to_build_ReadOnlyStyledDocument_using_empty_paragraph_list_throws_exception() { ReadOnlyStyledDocumentBuilder<String, String, String> builder = new ReadOnlyStyledDocumentBuilder<>( SEGMENT_OPS, "ps style" ); try { builder.build(); fail("Cannot build a ReadOnlyStyledDocument with an empty list of paragraphs"); } catch (IllegalStateException e) { } }