code: public static Cells getCellFromJson(JSONObject Json, String tableName)
              throws IllegalAccessException, InstantiationException, InvocationTargetException {
  
          Cells cells = tableName != null ? new Cells(tableName) : new Cells();
  
          Set<String> entrySet = Json.keySet();
  
          for (String key : entrySet) {
              try {
                  Object value = Json.get(key);
  
                  if (List.class.isAssignableFrom(value.getClass())) {
                      List<Cells> innerCell = new ArrayList<>();
                      for (JSONObject innerBson : (List<JSONObject>) value) {
                          innerCell.add(getCellFromJson(innerBson, null));
                      }
                      cells.add(Cell.create(key, innerCell));
                  } else if (JSONObject.class.isAssignableFrom(value.getClass())) {
                      Cells innerCells = getCellFromJson((JSONObject) value, null);
                      cells.add(Cell.create(key, innerCells));
                  } else {
                      if (key.equalsIgnoreCase("id")) {
                          cells.add(Cell.create(key, value, true));
                      } else {
                          cells.add(Cell.create(key, value));
  
                      }
                  }
              } catch (IllegalAccessException | InstantiationException | InvocationTargetException | IllegalArgumentException e) {
                                  LOG.error("impossible to create a java cell from Json field:"+key);
              }
  
          }
          return cells;
      }
docs: converts from cell class to JSONObject
  
  @param Json      the json
  @param tableName the table name
  @return cell from json
  @throws IllegalAccessException the illegal access exception
  @throws IllegalAccessException the instantiation exception
  @throws IllegalAccessException the invocation target exception