Preconditions { public static void checkArgument(boolean expression) { if (!expression) { throw new IllegalArgumentException(); } } private  Preconditions(); static void checkArgument(boolean expression); static void checkNotOnMainThread();  }
@Test public void should_do_nothing_when_argument_is_valid() { boolean argument = true; Preconditions.checkArgument(argument); }
@Test(expected = IllegalArgumentException.class) public void should_throw_IllegalArgumentException_when_argument_is_invalid() { boolean argument = false; Preconditions.checkArgument(argument); }