package com.placeholder.rich.todotreeprototype.model;

public class Item {
    private final String name;
    private boolean complete;

    public Item(String name) {
        this(name, false);
    }

    public Item(String name, boolean complete) {
        this.name = name;
        this.complete = complete;
    }

    public String getName() {
        return name;
    }

    public boolean isComplete() {
        return complete;
    }

    public boolean toggleComplete() {
        return complete = !complete;
    }

}

package com.placeholder.rich.todotreeprototype.model;

public class Item {
    private final String name;
    private boolean complete;
    private int nSubItems;
    private int nItemsLeft;

    public Item(String name) {
        this(name, false, 0, 0);
    }

    public Item(String name, boolean complete) {
        this(name, complete, 0, 0);
    }

    public Item(String name, boolean complete, int nSubItems, int nItemsLeft) {
        this.name = name;
        this.complete = complete;
        this.nSubItems = nSubItems;
        this.nItemsLeft = nItemsLeft;
    }

    public String getName() {
        return name;
    }

    public boolean isComplete() {
        return complete;
    }

    public boolean toggleComplete() {
        return complete = !complete;
    }

    public int getNSubItems() {
        return nSubItems;
    }

    public int getNItemsLeft() {
        return nItemsLeft;
    }

    public boolean hasSubItems() {
        return nSubItems > 0;
    }

}

Add number of sub items to model