code: private static void verifyAncestry(Class<?> tClass) {
      if (!TBase.class.isAssignableFrom(tClass)) {
        Utils.ensureClassLoaderConsistency(TBase.class, tClass.getClassLoader());
        throw new ClassCastException(tClass.getName() + " is not a Thrift class");
      }
    }
docs: Verify that clazz is a Thrift class. i.e. is a subclass of TBase