code: public static ClassLoader getAndSetLoader(ClassLoader newCL) {
          ThreadContextAccessor tca = ThreadContextAccessor.getThreadContextAccessor();
          //This could be a ClassLoader or the special type UNCHANGED.
          Object maybeOldCL = tca.pushContextClassLoaderForUnprivileged(newCL);
          if (maybeOldCL instanceof ClassLoader) {
              return (ClassLoader) maybeOldCL;
          } else {
              return newCL;
          }
      }
docs: This method sets the thread context classloader, and returns whatever was the TCCL before it was updated.
  
  @param newCL the classloader to put on the thread context.
  @return the classloader that was origonally on the thread context.
  @throws SecurityException if <code>RuntimePermission("getClassLoader")</code> or <code>RuntimePermission("setContextClassLoader")</code> is not granted.