code: private static boolean isKnownLeafClassLoader(final ClassLoader classLoader) {
  
          if (classLoader == null) {
              return false;
          }
  
          if (!isKnownClassLoaderAccessibleFrom(classClassLoader, classLoader)) {
              // We cannot access the class class loader from the specified class loader, so this is not a leaf
              return false;
          }
  
          // Now we know there is a way to reach the class class loader from the argument class loader, so we should
          // base or results on whether there is a way to reach the system class loader from the class class loader.
          return systemClassLoaderAccessibleFromClassClassLoader;
  
      }
docs: /*
  This method determines whether it is known that a this class loader is a "leaf", in the sense that
  going up through its hierarchy we are able to find both the class class loader and the system class
  loader. This is used for determining whether we should be confident on the thread-context class loader
  delegation mechanism or rather try to perform class/resource resolution manually on the other class loaders.