public static void checkState(boolean isValid, String message, Object... args)
      throws IllegalStateException {
    if (!isValid) {
      throw new IllegalStateException(
          String.format(String.valueOf(message), strings(args)));
    }
  }
public static void checkState(boolean isValid, String message, Object... args)
      throws IllegalStateException {
    if (!isValid) {
      throw new IllegalStateException(
          String.format(String.valueOf(message), strings(args)));
    }
  }
public static void checkState ( boolean isValid , String message , Object ... args ) throws IllegalStateException { if ( ! isValid ) { throw new IllegalStateException ( String . format ( String . valueOf ( message ) , strings ( args ) ) ) ; } }
Precondition-style validation that throws {@link IllegalStateException}.

@param isValid
{@code true} if valid, {@code false} if an exception should be
thrown
@param message
A String message for the exception.
@param args
Objects used to fill in {@code %s} placeholders in the message
@throws IllegalStateException if {@code isValid} is false
Precondition - style validation that throws { @link IllegalStateException } .