private AnnotationInvocationHandler asOneOfUs(Object o){
  if (Proxy.isProxyClass(o.getClass())) {
    InvocationHandler handler=Proxy.getInvocationHandler(o);
    if (handler instanceof AnnotationInvocationHandler)     return (AnnotationInvocationHandler)handler;
  }
  return null;
}

private AnnotationInvocationHandler asOneOfUs ( Object o ) { if ( Proxy . isProxyClass ( o . getClass ( ) ) ) { InvocationHandler handler = Proxy . getInvocationHandler ( o ) ; if ( handler instanceof AnnotationInvocationHandler ) return ( AnnotationInvocationHandler ) handler ; } return null ; }
returns an object ' s invocation handler if that object is a dynamic proxy with a handler of type annotationinvocationhandler . returns null otherwise .
