public static void assertMainThread() {
        if (!isOnMainThread()) {
            throw new IllegalArgumentException("You must call this method on the main thread");
        }
    }
Throws an {@link IllegalArgumentException} if called on a thread other than the main thread.
core/src/main/java/com/bumptech/glide/util/Util.java