Code example for AtomicReference

Methods: getset

        sepFwrC.getConstructor(Object.class, sepFrqC);
    // The object that we will wrap in FinalizableWeakReference is a Stopwatch. 
    Class<?> sepStopwatchC = sepLoader.loadClass(Stopwatch.class.getName());
    assertSame(sepLoader, sepStopwatchC.getClassLoader());
    AtomicReference<Object> sepStopwatchA =
        new AtomicReference<Object>(sepStopwatchC.newInstance());
    AtomicReference<WeakReference<?>> sepStopwatchRef =
        new AtomicReference<WeakReference<?>>(
            sepFwrCons.newInstance(sepStopwatchA.get(), sepFrqA.get()));
    // Clear all references to the Stopwatch and wait for it to be gc'd. 
    // Return a weak reference to the parallel ClassLoader. This is the reference that should 
    // eventually become clear if there are no other references to the ClassLoader. 
    return new WeakReference<ClassLoader>(sepLoader);
  private void doTestUnloadable() throws Exception { 
    WeakReference<ClassLoader> loaderRef = useFrqInSeparateLoader();
Connect your IDE to all the code out there  Get Codota for Java