code: public static Object unwrapProxy(Object bean, Boolean recursive) {
  
          Assert.notNull(recursive, "recursive");
  
          Object unwrapped = bean;
  
          // If the given object is a proxy, set the return value as the object being proxied, otherwise return the given
          // object
          if ((bean != null) && (bean instanceof Advised) && (AopUtils.isAopProxy(bean))) {
  
              final Advised advised = (Advised) bean;
              try {
                  final Object target = advised.getTargetSource().getTarget();
  
                  unwrapped = recursive ? ObjectUtils.unwrapProxy(target, recursive) : target;
              } catch (Exception e) {
                  unwrapped = bean;
                  ObjectUtils.LOGGER.warn("Failure unwrapping \"" + bean + "\".", e);
              }
          }
  
          return unwrapped;
      }
docs: This is a utility method for getting raw objects that may have been proxied. It is intended to be used in cases
  where raw implementations are needed rather than working with interfaces which they implement.
  
  @param bean
  the potential proxy.
  @param recursive
  whether to procceeed recursively through nested proxies.
  @return the unwrapped bean or <code>null</code> if target bean is <code>null</code>. If <code>recursive</code>
  parameter is <code>true</code> then returns the most inner unwrapped bean, otherwise the nearest target
  bean is returned.
  
  Based on this <a href="http://forum.springsource.org/showthread.php?t=60216">Spring forum topic</a>.
  @see Advised
  @since 20101223 thanks to <a href="http://jirabluebell.b2b2000.com/browse/BLUE-34">BLUE-34</a>