You were almost there, you can change your signature to get a BooleanSupplier , which will evaluate the condition only when called getAsBoolean.
:
public class Test {
public static void main(String args[]) {
A a = new A();
test(() -> a != null && a.get());
}
static void test(BooleanSupplier condition) {
condition.getAsBoolean();
}
static class A {
boolean get(){
return true;
}
}
}
, , a != null && a.get() condition.getAsBoolean().
,
void do_assertions( boolean argb , String args )
void do_assertions(BooleanSupplier argo_supplier , String args )
argo_supplier.getAsBoolean(), ( pvb_debuggable).
MyUtils.do_assertions( () -> lvo_editText != null , "bad EditText" );
( , ).