def java_is_subclass(obj, class_name):
    """Given a deserialized JavaObject as returned by the javaobj library,
    determine whether it's a subclass of the given class name.
    """
    clazz = obj.get_class()
    while clazz:
        if clazz.name == class_name:
            return True
        clazz = clazz.superclass
    return False