_setCheckedElements(value, check) {
      if (value === null || value === undefined) {
        // Uncheck all
        // eslint-disable-next-line no-return-assign, no-param-reassign
        this.formElements.forEach(fe => (fe.checked = false));
        return;
      }
      for (let i = 0; i < this.formElements.length; i += 1) {
        if (this.multipleChoice) {
          let valueIsIncluded = value.includes(this.formElements[i].modelValue.value);

          // For complex values, do a JSON Stringified includes check, because [{ v: 'foo'}].includes({ v: 'foo' }) => false
          if (typeof this.formElements[i].modelValue.value === 'object') {
            valueIsIncluded = /** @type {any[]} */ (value)
              .map(/** @param {Object} v */ v => JSON.stringify(v))
              .includes(JSON.stringify(this.formElements[i].modelValue.value));
          }

          this.formElements[i].checked = valueIsIncluded;
        } else if (check(this.formElements[i], value)) {
          // Allows checking against custom values e.g. formattedValue or serializedValue
          this.formElements[i].checked = true;
        } else {
          this.formElements[i].checked = false;
        }
      }
    }
@param {string | any[]} value
@param {Function} check
@protected