docs: @SuppressWarnings({"WMI", "unchecked"})
      public DBObject callLifecycleMethods(final Class<? extends Annotation> event, final Object entity, final DBObject dbObj,
                                           final Mapper mapper) {
          final List<ClassMethodPair> methodPairs = getLifecycleMethods((Class<Annotation>) event);
          DBObject retDbObj = dbObj;
          try {
              Object tempObj;
              if (methodPairs != null) {
                  final HashMap<Class<?>, Object> toCall = new HashMap<Class<?>, Object>((int) (methodPairs.size() * 1.3));
                  for (final ClassMethodPair cm : methodPairs) {
                      toCall.put(cm.clazz, null);
                  }
                  for (final Class<?> c : toCall.keySet()) {
                      if (c != null) {
                          toCall.put(c, getOrCreateInstance(c, mapper));
                      }
                  }
  
                  for (final ClassMethodPair cm : methodPairs) {
                      final Method method = cm.method;
                      final Object inst = toCall.get(cm.clazz);
                      method.setAccessible(true);
  
                      if (LOG.isDebugEnabled()) {
                          LOG.debug(format("Calling lifecycle method(@%s %s) on %s", event.getSimpleName(), method, inst));
                      }
  
                      if (inst == null) {
                          if (method.getParameterTypes().length == 0) {
                              tempObj = method.invoke(entity);
                          } else {
                              tempObj = method.invoke(entity, retDbObj);
                          }
                      } else if (method.getParameterTypes().length == 0) {
                          tempObj = method.invoke(inst);
                      } else if (method.getParameterTypes().length == 1) {
                          tempObj = method.invoke(inst, entity);
                      } else {
                          tempObj = method.invoke(inst, entity, retDbObj);
                      }
  
                      if (tempObj != null) {
                          retDbObj = (DBObject) tempObj;
                      }
                  }
              }
  
              callGlobalInterceptors(event, entity, dbObj, mapper);
          } catch (IllegalAccessException e) {
              throw new RuntimeException(e);
          } catch (InvocationTargetException e) {
              throw new RuntimeException(e);
          }
  
          return retDbObj;
      }