private static <T, P extends Trespasser<T>> ProxyWrapper<T,P> validateProxyInterface(
      final Class<P> proxy, final ClassLoader loader)
      throws NoSuchMethodException, NoSuchFieldException, InvalidSignatureException,
             ClassNotFoundException, MissingAnnotationException
   {
      @SuppressWarnings("unchecked")
      final Class<P> proxyClass = (Class<P>)Proxy.getProxyClass(loader, proxy);
      @SuppressWarnings("unchecked")
      ProxyWrapper<T,P> info = (ProxyWrapper<T,P>)validProxies.get(proxyClass);
      if (info == null)
      {
         Method instanceProvider = null;
         final Class<T> target = validateTargetClass(proxy, loader);
         final Method[] proxyMethods = proxy.getMethods();

         for (Method m : proxyMethods)
         {
            final Class<?>[] proxyParams = m.getParameterTypes();
            if (Trespasser.PROXY_INST_GETTER.equals(m.getName()) && proxyParams.length == 0 && m.getReturnType().isAssignableFrom(target))
            {
               continue;
            }
            if (instanceProvider == null &&
                m.isAnnotationPresent(DefaultInstanceProvider.class))
            {
               instanceProvider = m;
               validateProxyInstanceProvider(proxy, m, proxyParams, target, loader);
            }
            else if (m.isAnnotationPresent(ProxyField.class))
            {
               final String fieldName = getProxyFieldName(m);
               validateFieldProxy(proxy, m, proxyParams, target, fieldName, loader);
            }
            else
            {
               validateProxyMethod(proxy, m, proxyParams, target, loader);
            }
         }
         info = new ProxyWrapper<T,P>(proxyClass, target, instanceProvider);
         validProxies.put(proxyClass, info);
      }
      return info;
   }