public static void assertMainThread ( ) { if ( imp != null && ! DispatchQueue . isMainQueue ( ) ) { imp . assertFailed ( StringUtils . format ( "Expected 'main' thread but was '%s'" , Thread . currentThread ( ) . getName ( ) ) ) ; } }
Asserts that code executes on the main thread .