@SuppressWarnings("unchecked") public static <T>T newProxyInstance(Class<T> interfaceClass,T delegate,Strictness strictness,Thread current){
  return (T)Proxy.newProxyInstance(interfaceClass.getClassLoader(),new Class<?>[]{interfaceClass},new ThreadConfinedProxy(delegate,strictness,current.getName(),current.getId()));
}

@ SuppressWarnings ( "unchecked" ) public static < T > T newProxyInstance ( Class < T > interfaceClass , T delegate , Strictness strictness , Thread current ) { return ( T ) Proxy . newProxyInstance ( interfaceClass . getClassLoader ( ) , new Class < ? > [ ] { interfaceClass } , new ThreadConfinedProxy ( delegate , strictness , current . getName ( ) , current . getId ( ) ) ) ; }
creates a new threadconfinedproxy with the given strictness ( assert_and_log or validate ) , initially assigned to the given thread .
