Assert { public static void state(boolean flag, String comment, Object... params) { if (!flag) { throw new IllegalStateException(message(comment, params)); } } private  Assert(); static void notNull(Object value, String comment, Object... params); static void hasLength(CharSequence value, String comment, Object... params); static void isTrue(boolean flag, String comment, Object... params); static void state(boolean flag, String comment, Object... params); static String message(String message, Object... params);  }
@Test public void stateWithDummyValues() { state(1 != 2, "Test comment"); assertThatThrownBy(new ThrowableAssert.ThrowingCallable() { @Override public void call() { state(3 == 4, "State is not true"); } }).isInstanceOf(IllegalStateException.class).hasMessage("State is not true"); }