code: public static boolean safeIsAssignableFrom(Object obj, String className) {
        try {
           Class<?> clazz = Class.forName(className);
           return clazz.isAssignableFrom(obj.getClass());
        } catch (ClassNotFoundException ignored) {
           return false;
        }
     }
docs: Checks whether an object is an instance of given type without throwing exception when the class is not loaded.
  @param obj the object to check
  @param className String class
  @return true if object is assignable from the type, false otherwise or when the class cannot be loaded