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