public static void checkValid(boolean isValid, String argName) {
    checkArgument(isValid, "'%s' is invalid.", argName);
  }
@Test
  public void testCheckValid() throws Exception {
    // Should not throw.
    Validate.checkValid(true, "arg");

    // Verify it throws.
    ExceptionAsserts.assertThrows(
        IllegalArgumentException.class,
        "'arg' is invalid",
        () -> Validate.checkValid(false, "arg"));
  }