code: public static boolean isAssignableToOrFrom(Class<?> classToCheck, Class<?> anotherClass) {
      return classToCheck.isAssignableFrom(anotherClass)
          || anotherClass.isAssignableFrom(classToCheck);
    }
docs: Returns whether a class is either assignable to or from another class.
  
  @param classToCheck class to check
  @param anotherClass another class