code: public static URL getDeepResource(ClassLoader startLoader, String resourceName) {
          ClassLoader currentLoader = checkNotNull(startLoader);
          URL url = currentLoader.getResource(checkNotEmpty(resourceName));
          int attempts = 0;
          while (url == null && attempts < 10) {  // search the class loader tree
              currentLoader = currentLoader.getParent();
              attempts += 1;
              //no inspection ConstantConditions
              if (currentLoader == null) {
                  break;  // we are at the bootstrap class loader
              }
              url = currentLoader.getResource(resourceName);
          }
          checkArgument(url != null, "resource %s not found for the context class loader %s", resourceName, startLoader);
          return url;
      }
docs: Search class loader tree for resource, current implementation
  attempts up to 10 levels of nested class loaders.
  
  @param startLoader class loader to start from
  @param resourceName  the resource name on class path
  @return A {@link URL} object for reading the resource
  @throws java.lang.IllegalArgumentException if the resource could not be found
  or the invoker doesn't have adequate privileges to get the resource
  @see java.lang.ClassLoader#getResource(String)