public void setUpToClass(Class<?> clazz) {
        if (clazz != null) {
            Object object = getObject();
            if (object != null && clazz.isInstance(object) == false) {
                throw new IllegalArgumentException("Specified class is not a superclass of the object");
            }
        }
        this.upToClass = clazz;
    }
<p>
Sets the last super class to stop appending fields for.
</p>

@param clazz
           The last super class to stop appending fields for.
android/android_framework/base/src/main/java/lang3/builder/ReflectionToStringBuilder.java