class Content {

    private final TextSegment textSegment;

    public Content(String text) {
        this(TextSegment.from(text));
    }

    public Content(TextSegment textSegment) {
        this.textSegment = ensureNotNull(textSegment, "textSegment");
    }

    public TextSegment textSegment() {
        return textSegment;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Content that = (Content) o;
        return Objects.equals(this.textSegment, that.textSegment);
    }

    @Override
    public int hashCode() {
        return Objects.hash(textSegment);
    }

    @Override
    public String toString() {<FILL_FUNCTION_BODY>}

    public static Content from(String text) {
        return new Content(text);
    }

    public static Content from(TextSegment textSegment) {
        return new Content(textSegment);
    }
}

        return "Content {" +
                " textSegment = " + textSegment +
                " }";
    
<no_super_class>