code: public void addOrInsertMethod(InsertableMethod insertableMethod) throws CannotCompileException, AfterBurnerImpossibleException {
          log.info("InsertableMethod : " + insertableMethod);
          // create or complete onViewCreated
          String targetMethodName = insertableMethod.getTargetMethodName();
          CtClass classToTransform = insertableMethod.getClassToInsertInto();
          CtMethod targetMethod = extractExistingMethod(classToTransform,
                  targetMethodName);
          log.info("Method : " + targetMethod);
          if (targetMethod != null) {
              InsertableMethodInjectorEditor injectorEditor = new InsertableMethodInjectorEditor(
                      classToTransform, insertableMethod);
              targetMethod.instrument(injectorEditor);
              if (!injectorEditor.isSuccessful) {
                  throw new CannotCompileException("Transformation failed. Insertion method not found.: " + targetMethodName);
              }
          } else {
              classToTransform.addMethod(CtNewMethod.make(
                      insertableMethod.getFullMethod(), classToTransform));
          }
      }
docs: Add/Inserts java instructions into a given method of a given class.
  @param insertableMethod contains all information to perform byte code injection.
  @throws CannotCompileException if the source contained in insertableMethod can't be compiled.
  @throws AfterBurnerImpossibleException if something else goes wrong, wraps other exceptions.