class AbstractLazyCharSequence implements IWritableCharSequence {


    private String resolvedText = null;




    protected AbstractLazyCharSequence() {
        super();
    }



    protected abstract String resolveText();



    private String getText() {
        if (this.resolvedText == null) {
            this.resolvedText = resolveText();
        }
        return this.resolvedText;
    }




    public final int length() {
        return getText().length();
    }




    public final char charAt(final int index) {
        return getText().charAt(index);
    }




    public final CharSequence subSequence(final int beginIndex, final int endIndex) {
        return getText().subSequence(beginIndex, endIndex);
    }



    public final void write(final Writer writer) throws IOException {<FILL_FUNCTION_BODY>}


    protected abstract void writeUnresolved(final Writer writer) throws IOException;




    @Override
    public final boolean equals(final Object o) {

        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        final AbstractLazyCharSequence that = (AbstractLazyCharSequence) o;

        return this.getText().equals(that.getText());

    }


    public final int hashCode() {
        return getText().hashCode();
    }




    @Override
    public final String toString() {
        return getText();
    }



}

        if (writer == null) {
            throw new IllegalArgumentException("Writer cannot be null");
        }
        if (this.resolvedText != null) {
            writer.write(this.resolvedText);
        } else {
            writeUnresolved(writer);
        }
    
<no_super_class>