code: public static <T> T getObjectFromBson(Class<T> classEntity, BSONObject bsonObject)
              throws IllegalAccessException, InstantiationException, InvocationTargetException {
          T t = classEntity.newInstance();
  
          Field[] fields = AnnotationUtils.filterDeepFields(classEntity);
  
          Object insert = null;
  
          for (Field field : fields) {
              Object currentBson = null;
              Method method = null;
              try {
                  method = Utils.findSetter(field.getName(), classEntity, field.getType());
  
                  Class<?> classField = field.getType();
  
                  currentBson = bsonObject.get(AnnotationUtils.deepFieldName(field));
                  if (currentBson != null) {
  
                      if (Iterable.class.isAssignableFrom(classField)) {
                          Type type = field.getGenericType();
  
                          insert = subDocumentListCase(type, (List) bsonObject.get(AnnotationUtils.deepFieldName(field)));
  
                      } else if (IDeepType.class.isAssignableFrom(classField)) {
                          insert = getObjectFromBson(classField, (BSONObject) bsonObject.get(AnnotationUtils.deepFieldName
                                  (field)));
                      } else {
                          insert = currentBson;
                      }
                      method.invoke(t, insert);
                  }
              } catch (IllegalAccessException | InstantiationException | InvocationTargetException | IllegalArgumentException e) {
                  LOG.error("impossible to create a java object from Bson field:" + field.getName() + " and type:" + field
                          .getType() + " and value:" + t + "; bsonReceived:" + currentBson + ", bsonClassReceived:"
                          + currentBson.getClass());
  
                  method.invoke(t, Utils.castNumberType(insert, t.getClass()));
              }
  
          }
  
          return t;
      }
docs: converts from BsonObject to an entity class with deep's anotations
  
  @param classEntity the entity name.
  @param bsonObject  the instance of the BSONObjet to convert.
  @return the provided bsonObject converted to an instance of T.
  @throws IllegalAccessException the illegal access exception
  @throws IllegalAccessException the instantiation exception
  @throws IllegalAccessException the invocation target exception