/** * Throws an {@link AssertionException} if the current thread is the UI thread. */ public static void assertNotOnUiThread() { SoftAssertions.assertCondition(!isOnUiThread(), "Expected not to run on UI thread!"); }
/** * Throws an {@link AssertionException} if the current thread is not the UI thread. */ public static void assertOnUiThread() { SoftAssertions.assertCondition(isOnUiThread(), "Expected to run on UI thread!"); }