public static void isTrue ( final String name , final boolean condition , final SingleResultCallback < ? > callback ) { if ( ! condition ) { IllegalStateException exception = new IllegalStateException ( "state should be: " + name ) ; callback . onResult ( null , exception ) ; throw exception ; } }
Throw IllegalStateException if the condition if false .