code: @Trivial
      private void inject(Object obj, final Object instance, HashMap<Class<?>, InjectionTarget[]> cookies) throws InjectionException {
          if (tc.isDebugEnabled())
              Tr.debug(tc, "inject", "obj --> [" + obj + "]");
          if (cookies.size() == 0) {
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "inject", "no injection cookies found");
              return;
          }
          if (tc.isDebugEnabled())
              Tr.debug(tc, "inject", "injection cookies found");
  
          // Note that 'obj' is a class.
          if (cookies.containsKey(obj)) { // To prevent NPE from the for loop below
  
              if (instance != null) {
                  if (tc.isDebugEnabled())
                      Tr.debug(tc, "inject", "about to inject via managed object --> [" + obj + "]");
  
                  final ManagedObject<?> mo;
                  try {
                      mo = getManagedObject(instance);
                      mo.inject(cookies.get(obj), null);// inject callback handler
                  } catch (Exception e) {
                      throw new InjectionException(e.getCause());
                  }
  
                  if (tc.isDebugEnabled())
                      Tr.debug(tc, "inject", "injected --> [" + obj + "]");
              } else {
                  for (InjectionTarget cookie : cookies.get(obj)) {
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "inject", "about to inject resource --> [" + cookie + "]");
  
                      injectionEngine.inject(obj, cookie, null); // inject main class
  
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "inject", "injected resource --> [" + cookie + "]");
                  }
              }
  
          } else {
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "inject", "cookies does not contains the key --> [" + obj + "]");
          }
      }
docs: 'instance' is considered as the first injection target but may be null in which case injection is done on 'obj'.