public static <PS, SEG, S> ReadOnlyStyledDocument<PS, SEG, S> constructDocument(
            SegmentOps<SEG, S> segmentOps, PS defaultParagraphStyle,
            Consumer<ReadOnlyStyledDocumentBuilder<PS, SEG, S>> configuration) {
        ReadOnlyStyledDocumentBuilder<PS, SEG, S> builder = new ReadOnlyStyledDocumentBuilder<>(segmentOps, defaultParagraphStyle);
        configuration.accept(builder);
        return builder.build();
    }
public static < PS , SEG , S > ReadOnlyStyledDocument < PS , SEG , S > constructDocument ( SegmentOps < SEG , S > segmentOps , PS defaultParagraphStyle , Consumer < ReadOnlyStyledDocumentBuilder < PS , SEG , S > > configuration ) { ReadOnlyStyledDocumentBuilder < PS , SEG , S > builder = new ReadOnlyStyledDocumentBuilder < > ( segmentOps , defaultParagraphStyle ) ; configuration . accept ( builder ) ; return builder . build ( ) ; }
Constructs a list of paragraphs

@param segmentOps the {@link SegmentOps} object to use for one of the {@link Paragraph}'s constructors
@param defaultParagraphStyle the paragraph style object to use when it is not specified in the
"addParagraph" methods
@param configuration call the builder's {@link #addParagraph(Object, Object)} methods here