code: public static void checkParam(boolean expression, Object errorMessage) {
      if (!expression) {
        Response response = Response.status(Response.Status.BAD_REQUEST)
            .type(MediaType.TEXT_PLAIN)
            .build();
        throw new WebApplicationException(String.valueOf(errorMessage), response);
      }
    }
docs: Ensures the truth of an expression involving a jax-rs parameter.
  
  @param expression a boolean expression
  @param errorMessage the exception message to use if the check fails; will
  be converted to a string using {@link String#valueOf(Object)}
  @throws WebApplicationException with response status 400 if {@code expression} is false