code: public static boolean isSubclass(Class superclass, Class otherclass) {
      Class       currentclass;
      boolean     result;
      String	key;
  
      key = superclass.getName() + "-" + otherclass.getName();
      if (m_CheckSubClass.containsKey(key))
        return m_CheckSubClass.get(key);
  
      currentclass = otherclass;
      do {
        result = currentclass.equals(superclass);
  
        // topmost class reached?
        if (currentclass.equals(Object.class) || (currentclass.getSuperclass() == null))
          break;
  
        if (!result)
          currentclass = currentclass.getSuperclass();
      }
      while (!result);
  
      m_CheckSubClass.put(key, result);
  
      return result;
    }
docs: Checks whether the "otherclass" is a subclass of the given "superclass".
  
  @param superclass      the superclass to check against
  @param otherclass      this class is checked whether it is a subclass
  of the the superclass
  @return                TRUE if "otherclass" is a true subclass