### Question:
Preconditions { public static void checkArgument(boolean expression) { if (!expression) { throw new IllegalArgumentException(); } } private  Preconditions(); static void checkArgument(boolean expression); static void checkArgument(boolean expression,
                                            @Nullable
                                            Object errorMessage); static void checkArgument(boolean expression,
                                            @Nullable
                                            String errorMessageTemplate,
                                            @Nullable
                                            Object... errorMessageArgs); static void checkState(boolean expression); static void checkState(boolean expression,
                                         @Nullable
                                         Object errorMessage); static void checkState(boolean expression,
                                         @Nullable
                                         String errorMessageTemplate,
                                         @Nullable
                                         Object... errorMessageArgs); static T checkNotNull(T reference); static T checkNotNull(T reference, @Nullable
    Object errorMessage); static T checkNotNull(T reference,
                                            @Nullable
                                            String errorMessageTemplate,
                                            @Nullable
                                            Object... errorMessageArgs); static int checkElementIndex(int index, int size); static int checkElementIndex(int index, int size,
                                               @Nullable
                                               String desc); static int checkPositionIndex(int index, int size); static int checkPositionIndex(int index, int size,
                                                @Nullable
                                                String desc); static void checkPositionIndexes(int start, int end, int size);  }### Answer:
@Test public void testCheckArguments() { Preconditions.checkArgument(true); Preconditions.checkArgument(true, msgObject); Preconditions .checkArgument(true, "one %s two %s", msgObject, msgObject); }
@Test(expected = IllegalArgumentException.class) public void testFalseCheckArguments() { Preconditions.checkArgument(false); }
@Test(expected = IllegalArgumentException.class) public void testFalseCheckArgumentsSingleMsg() { Preconditions.checkArgument(false, msgObject); }
@Test(expected = IllegalArgumentException.class) public void testFalseCheckArgumentsMultiMessage() { Preconditions .checkArgument(false, "one %s two %s", msgObject, msgObject); }