package yokohama.unit.util;

import lombok.Getter;
import org.apache.commons.lang3.text.StrBuilder;

public class SBuilder {

    private final StrBuilder sb = new StrBuilder();
    private final int shiftWidth;

    @Getter
    private int indent = 0;

    public SBuilder(int shiftWidth) {
        this.shiftWidth = shiftWidth;
    }
    
    public SBuilder appendln(final Object... array) {
        if (array.length > 0) {
            sb.appendPadding(indent, ' ');
            for (Object obj : array) {
                sb.append(obj);
            }
        }
        sb.appendNewLine();
        return this;
    }

    public SBuilder shift() {
        indent += shiftWidth;
        return this;
    }
    
    public SBuilder unshift() {
        indent = indent < shiftWidth ? 0 : indent - shiftWidth;
        return this;
    }
    
    @Override
    public String toString() {
        return sb.toString();
    }
}

@@ -97,16 +97,95 @@
 ilder;%0D%0A
+import yokohama.unit.annotations.Invariant;%0D%0A%0D%0A@Invariant(%22%7B it.indent %3E= 0 %7D%22)
 %0D%0Apublic

Add Invariant annotation to SBuilder class