package de.philipphager.disclosure.util.assertion;

public final class Assertions {
  @SuppressWarnings("PMD.UnnecessaryConstructor") private Assertions() {
    //No instances of helper classes.
  }

  public static <T> T ensureNotNull(T t) {
    if (t == null) {
      throw new IllegalStateException("must not be null");
    }
    return t;
  }

  public static <T> T ensureNotNull(T t, String message) {
    if (t == null) {
      throw new IllegalStateException(message);
    }
    return t;
  }
}

@@ -492,11 +492,154 @@
 n t;%0A  %7D
+%0A%0A  public static void check(boolean argument, String message) %7B%0A    if (!argument) %7B%0A      throw new IllegalStateException(message);%0A    %7D%0A  %7D
 %0A%7D%0A

Add util assertion method to check a state.