code: public static JSONObject getJsonFromCell(Cells cells)
              throws IllegalAccessException, InstantiationException, InvocationTargetException {
  
          JSONObject json = new JSONObject();
          for (Cell cell : cells) {
              if (cell.getCellValue() != null) {
                  if (Collection.class.isAssignableFrom(cell.getCellValue().getClass())) {
                      Collection c = (Collection) cell.getCellValue();
                      Iterator iterator = c.iterator();
                      List innerJsonList = new ArrayList<>();
  
                      while (iterator.hasNext()) {
                          Object innerObject = iterator.next();
                          if(innerObject instanceof Cells){
                              innerJsonList.add(getJsonFromCell((Cells)innerObject ));
                          }else{
                              innerJsonList.add(innerObject);
                          }
  
                      }
                      json.put(cell.getCellName(), innerJsonList);
                  } else if (Cells.class.isAssignableFrom(cell.getCellValue().getClass())) {
                      json.put(cell.getCellName(), getJsonFromCell((Cells) cell.getCellValue()));
                  } else {
                      json.put(cell.getCellName(), cell.getCellValue());
                  }
  
              }
          }
  
          return json;
      }
docs: converts from cell class to JSONObject
  
  @param cells the cells
  @return json from cell
  @throws IllegalAccessException the illegal access exception
  @throws IllegalAccessException the instantiation exception
  @throws IllegalAccessException the invocation target exception