ClassLoader loader = new URLClassLoader(new URL[0], ClassLoader.getSystemClassLoader());
Method m = ClassLoader.class.getDeclaredMethod("defineClass", String.class,
byte[].class, Integer.TYPE, Integer.TYPE);
ReflectionUtil.setAccessible(m).invoke(loader, ReferencingAuthenticator.class.getName(),
b, 0, b.length);
Class<?> cls = loader.loadClass(ReferencingAuthenticator.class.getName());
Authenticator auth = (Authenticator)cls.getConstructor(Authenticator.class, Authenticator.class)
.newInstance(INSTANCE, wrapped);
Authenticator.setDefault(auth);
} catch (Throwable t) {