code: public static boolean isInstanceOf(Object obj, String classSimpleName) {
      if (obj == null) {
        return false;
      }
      
      Class<?> currentClass = obj.getClass();
      while (currentClass != Object.class) {
        if (currentClass.getSimpleName().equals(classSimpleName)) {
          return true;
        } else {
          currentClass = currentClass.getSuperclass();
        }
      }
      return false;
    }
docs: Check whether an object is an instance of a specified class.
  
  @param obj the object to check
  @param classSimpleName the simple name of the specified class.
  @return true if the object is an instance of the specified class