code: private static boolean isAncestor(ClassLoader p, ClassLoader cl) {
          ClassLoader acl = cl;
          do {
              acl = acl.getParent();
              if (p == acl) {
                  return true;
              }
          } while (acl != null);
          return false;
      }
docs: be found in the cl's delegation chain