public static void validState(final boolean expression, final String message, final Object... values) {
        if (!expression) {
            throw new IllegalStateException(StringUtils.simpleFormat(message, values));
        }
    }
public static void validState ( final boolean expression , final String message , final Object ... values ) { if ( ! expression ) { throw new IllegalStateException ( StringUtils . simpleFormat ( message , values ) ) ; } }
<p>Validate that the stateful condition is {@code true}; otherwise
throwing an exception with the specified message. This method is useful when
validating according to an arbitrary boolean expression, such as validating a
primitive number or using your own custom validation expression.</p>

<pre>Validate.validState(this.isOk(), "The state is not OK: %s", myObject);</pre>

@param expression  the boolean expression to check
@param message  the {@link String#format(String, Object...)} exception message if invalid, not null
@param values  the optional values for the formatted exception message, null array not recommended
@throws IllegalStateException if expression is {@code false}
@see #validState(boolean)

@since 3.0