@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"); } }
public static void checkArgument(boolean condition) { checkArgument(condition, null, null); }
Util { public static void checkArgument(boolean condition) { checkArgument(condition, null, null); } }
Util { public static void checkArgument(boolean condition) { checkArgument(condition, null, null); } private  Util(); }
Util { public static void checkArgument(boolean condition) { checkArgument(condition, null, null); } private  Util(); static boolean isNullOrEmpty(String s); static void checkArgument(boolean condition); static void checkArgument(boolean condition, String error, Object arg1); }
Util { public static void checkArgument(boolean condition) { checkArgument(condition, null, null); } private  Util(); static boolean isNullOrEmpty(String s); static void checkArgument(boolean condition); static void checkArgument(boolean condition, String error, Object arg1);  }