code: public static void checkState(boolean condition, String message, Object... args)
        throws IllegalStateException {
      if (!condition) {
        throw new IllegalStateException(String.format(message, args));
      }
    }
docs: Checks a certain state.
  
  @param  condition the condition of the state that has to be true
  @param  message   the error message if {@code condition} is false
  @param  args      the arguments to the error message
  
  @throws IllegalStateException if {@code condition} is false