class IterationStatusVar {

    int index;
    Integer size; // it can be null if we don't know the size of the iterated object beforehand!
    Object current;

    IterationStatusVar() {
        super();
    }

    public int getIndex() {
        return this.index;
    }

    public int getCount() {
        return this.index + 1;
    }

    public boolean hasSize() {
        return this.size != null;
    }

    public Integer getSize() {
        return this.size;
    }

    public Object getCurrent() {
        return this.current;
    }

    public boolean isEven() {
        // We start counting in 1 in order to be consistent with :nth-child(odd) and :nth-child(even) CSS selectors
        return ((this.index + 1) % 2 == 0);
    }

    public boolean isOdd() {
        return !isEven();
    }

    public boolean isFirst() {
        return (this.index == 0);
    }

    public boolean isLast() {
        return (this.index == this.size - 1);
    }

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

}

        return "{index = " + this.index + ", count = " + (this.index + 1) +
                ", size = " + this.size + ", current = " + (this.current == null? "null" : this.current.toString()) + "}";
    
<no_super_class>