code: static void populateCellValue(final Cell cell, final ICellValue value) {
          if (cell == null) { return; }
          
          int cellType = resolveCellType(value);
          cell.setCellType(cellType);
          switch (cellType) {
              case CELL_TYPE_BLANK: { break; }
              case CELL_TYPE_BOOLEAN: { cell.setCellValue((Boolean) value.get()); break; }
              case CELL_TYPE_NUMERIC: { cell.setCellValue((Double) value.get()); break; }
              case CELL_TYPE_FORMULA: {
                  try {
                      cell.setCellFormula(((String) value.get()).substring(1));
                      break;
                  } catch (FormulaParseNameException e) {
                      log.error("Formula parsing error while trying to set formula field in cell " + e.getMessage());
                      cell.setCellFormula(ErrorEval.NAME_INVALID.getErrorString());
                      break;
                  } catch (FormulaParseNAException e) {
                      log.error("Formula parsing error while trying to set formula field in cell " + e.getMessage());
                      cell.setCellFormula(ErrorEval.NA.getErrorString());
                      break;
                  }
              }
              case CELL_TYPE_ERROR: { cell.setCellErrorValue(FormulaError.forString((String) value.get()).getCode()); break; }
              case CELL_TYPE_STRING: { cell.setCellValue((String) value.get()); break; }
              
              default: { throw new CalculationEngineException(String.format("Type of value %s is not supported: %s", value, value.getClass().getSimpleName())); }
          }
      }
docs: Inserts a value to a Cell based on a value type (class).