withSwitchedInitialStateOn(wire, newStateIndex=undefined) {
        let m = new Map([...this.customInitialValues.entries()]);
        let v = m.get(wire);
        let cycle = [...INITIAL_STATES_TO_GATES.keys()];
        let newVal = cycle[(cycle.indexOf(v) + 1) % cycle.length];
        if (newStateIndex !== undefined) {
            newVal = newStateIndex;
        }
        if (newVal === undefined || newVal === 0) {
            m.delete(wire);
        } else {
            m.set(wire, newVal);
        }
        return this.withInitialStates(m);
    }
@param {!int} wire
@param {!int=} newStateIndex=
@returns {!CircuitDefinition}