@Test
public void testCheckArgument() throws Exception {

  Util.checkArgument(true, null, null);
  try {
    Util.checkArgument(false, null, null);
    fail("expected failure");
  } catch (IllegalArgumentException e) {
    assertThat(e).hasMessageThat().isEqualTo("argument validation failed");
  }
  try {
    Util.checkArgument(false, "foo-%s", 42);
    fail("expected failure");
  } catch (IllegalArgumentException e) {
    assertThat(e).hasMessageThat().isEqualTo("foo-42");
  }
}