code: @SuppressWarnings("squid:S2259") // Null pointers should not be dereferenced
    void setCellValue(Cell cell, Object value) {
      if (value instanceof Boolean) {
        cell.setCellValue(toBoolean(value));
      } else if (value instanceof LocalDate) {
        Instant instant = toLocalDate(value).atStartOfDay(timeZone.toZoneId()).toInstant();
        cell.setCellValue(simpleDateFormat.format(Date.from(instant)));
      } else if (value instanceof Instant) {
        cell.setCellValue(simpleDateTimeFormat.format(Date.from((Instant) value)));
      } else if (value instanceof Double) {
        cell.setCellValue(toDouble(value));
      } else if (value instanceof Integer) {
        cell.setCellValue(toInt(value));
      } else if (value instanceof Long) {
        cell.setCellValue(toLong(value));
      } else if (value instanceof String) {
        cell.setCellValue(value.toString());
      } else {
        throw new UnsupportedValueException(value);
      }
    }
docs: package-private for testability