code: public boolean isDeprecated(Class<?> clazz) {
  
          // check if class is marked as deprecated
          if (clazz.getAnnotation(Deprecated.class) != null) { 
              return true; 
          }
          
          // check if super class is deprecated
          Class<?> superClass = clazz.getSuperclass();
          if (superClass != null) {
              return isDeprecated(superClass);
          }
          
          // check if interfaces are deprecated
          for (Class<?> iface : clazz.getInterfaces()) {
              return isDeprecated(iface);
          }
          
          // not deprecated
          return false;
      }
docs: Returns whether the given class or any super class or interface is
  deprecated.
  
  @see Deprecated