code: @SuppressWarnings("unchecked")
      public static <T> boolean hasClass(Class<T> type, ClassLoader classloader) {
          try {
              loadClass(type.getName(), classloader);
              return true;
          } catch (RuntimeException e) {
              if(e.getCause() instanceof ClassNotFoundException) {
                  return false;
              }
              throw e;
          }
      }
docs: Check whether a classloader can load the given class.