package org.psjava.util;

public class Assertion {
    public static void ensure(boolean v) {
        ensure(v, "");
    }

    public static void ensureNotNull(Object v) {
        ensure(v != null, "Value cannot be a null");
    }

    public static void ensureNotNull(Object v, String message) {
        ensure(v != null, message);
    }

    public static void ensure(boolean v, String message) {
        if (!v)
            throw new RuntimeException(message);
    }
}

@@ -19,16 +19,53 @@
 .util;%0A%0A
+import java.util.function.Supplier;%0A%0A
 public c
@@ -422,32 +422,138 @@
 ring message) %7B%0A
+        ensure(v, () -%3E message);%0A    %7D%0A%0A    public static void ensure(boolean c, Supplier%3CString%3E msg) %7B%0A
         if (!v)%0A
@@ -549,17 +549,17 @@
    if (!
-v
+c
 )%0A      
@@ -592,22 +592,24 @@
 eption(m
-essage
+sg.get()
 );%0A    %7D

add util method - Assertion.ensure()