Check { public static <T> T nothing(final T t) { return t; } private  Check(); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotContainedArgumentException.class }) static T contains(@Nonnull final Collection<T> haystack, @Nonnull final T needle); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotContainedArgumentException.class }) static T contains(@Nonnull final Collection<T> haystack, @Nonnull final T needle, @Nonnull final String name); @Throws(IllegalNotEqualException.class) static boolean equals(final boolean expected, final boolean check); @Throws(IllegalNotEqualException.class) static boolean equals(final boolean expected, final boolean check, @Nonnull final String message); @Throws(IllegalNotEqualException.class) static byte equals(final byte expected, final byte check); @Throws(IllegalNotEqualException.class) static byte equals(final byte expected, final byte check, @Nonnull final String message); @Throws(IllegalNotEqualException.class) static char equals(final char expected, final char check); @Throws(IllegalNotEqualException.class) static char equals(final char expected, final char check, @Nonnull final String message); @Throws(IllegalNotEqualException.class) static int equals(final int expected, final int check); @Throws(IllegalNotEqualException.class) static int equals(final int expected, final int check, @Nonnull final String message); @Throws(IllegalNotEqualException.class) static long equals(final long expected, final long check); @Throws(IllegalNotEqualException.class) static long equals(final long expected, final long check, @Nonnull final String message); @Throws(IllegalNotEqualException.class) static short equals(final short expected, final short check); @Throws(IllegalNotEqualException.class) static short equals(final short expected, final short check, @Nonnull final String message); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotEqualException.class }) static T equals(@Nonnull final T expected, @Nonnull final T check); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotEqualException.class }) static T equals(@Nonnull final T expected, @Nonnull final T check); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotEqualException.class }) static T equals(@Nonnull final T expected, @Nonnull final T check, @Nonnull final String message); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotEqualException.class }) static T equals(@Nonnull final T expected, @Nonnull final T check, @Nonnull final String message); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotGreaterOrEqualThanException.class }) static T greaterOrEqualThan(@Nonnull final T expected, @Nonnull final T check); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotGreaterOrEqualThanException.class }) static T greaterOrEqualThan(@Nonnull final T expected, @Nonnull final T check,
			@Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static byte greaterThan(final byte expected, final byte check); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static byte greaterThan(final byte expected, final byte check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static char greaterThan(final char expected, final char check); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static char greaterThan(final char expected, final char check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static double greaterThan(final double expected, final double check); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static double greaterThan(final double expected, final double check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static float greaterThan(final float expected, final float check); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static float greaterThan(final float expected, final float check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static int greaterThan(final int expected, final int check); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static int greaterThan(final int expected, final int check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static long greaterThan(final long expected, final long check); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static long greaterThan(final long expected, final long check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static short greaterThan(final short expected, final short check); @ArgumentsChecked @Throws(IllegalNotGreaterThanException.class) static short greaterThan(final short expected, final short check, @Nonnull final String message); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotGreaterThanException.class }) static T greaterThan(@Nonnull final T expected, @Nonnull final T check); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotGreaterThanException.class }) static T greaterThan(@Nonnull final T expected, @Nonnull final T check, @Nonnull final String message); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalMissingAnnotationException.class }) static Annotation hasAnnotation(@Nonnull final Class<?> clazz, @Nonnull final Class<? extends Annotation> annotation); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalInstanceOfArgumentException.class }) @SuppressWarnings("unchecked") static T instanceOf(@Nonnull final Class<?> type, @Nonnull final Object obj); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalInstanceOfArgumentException.class }) @SuppressWarnings("unchecked") static T instanceOf(@Nonnull final Class<?> type, @Nonnull final Object obj, @Nullable final String name); @Throws(IllegalNotNullArgumentException.class) static void isNull(@Nullable final Object reference); @Throws(IllegalNotNullArgumentException.class) static void isNull(@Nullable final Object reference, @Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class }) static int isNumber(@Nonnull final String value); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class }) static T isNumber(@Nonnull final String value, @Nonnull final Class<T> type); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class }) static int isNumber(@Nonnull final String value, @Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class }) static T isNumber(@Nonnull final String value, @Nullable final String name, @Nonnull final Class<T> type); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNumberArgumentException.class }) static T isNumeric(@Nonnull final T value); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNumericArgumentException.class }) static T isNumeric(@Nonnull final T value, @Nullable final String name); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static byte lesserThan(final byte expected, final byte check); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static byte lesserThan(final byte expected, final byte check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static char lesserThan(final char expected, final char check); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static char lesserThan(final char expected, final char check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static double lesserThan(final double expected, final double check); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static double lesserThan(final double expected, final double check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static float lesserThan(final float expected, final float check); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static float lesserThan(final float expected, final float check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static int lesserThan(final int expected, final int check); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static int lesserThan(final int expected, final int check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static long lesserThan(final long expected, final long check); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static long lesserThan(final long expected, final long check, @Nonnull final String message); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static short lesserThan(final short expected, final short check); @ArgumentsChecked @Throws(IllegalNotLesserThanException.class) static short lesserThan(final short expected, final short check, @Nonnull final String message); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotLesserThanException.class }) static T lesserThan(@Nonnull final T expected, @Nonnull final T check); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNotLesserThanException.class }) static T lesserThan(@Nonnull final T expected, @Nonnull final T check, @Nonnull final String message); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalPatternArgumentException.class }) static T matchesPattern(@Nonnull final Pattern pattern, @Nonnull final T chars); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalPatternArgumentException.class }) static T matchesPattern(@Nonnull final Pattern pattern, @Nonnull final T chars,
			@Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNullElementsException.class }) static T noNullElements(@Nonnull final T iterable); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNullElementsException.class }) static T noNullElements(@Nonnull final T iterable, final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNullElementsException.class }) static T[] noNullElements(@Nonnull final T[] array); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalNullElementsException.class }) static T[] noNullElements(@Nonnull final T[] array, @Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static void notEmpty(final boolean expression); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static void notEmpty(final boolean expression, @Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T notEmpty(@Nonnull final T chars); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T notEmpty(@Nonnull final T collection); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T notEmpty(@Nonnull final T iterable); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T notEmpty(@Nonnull final T map); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T notEmpty(@Nonnull final T reference, final boolean expression, @Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T notEmpty(@Nonnull final T chars, @Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T notEmpty(@Nonnull final T map, @Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T notEmpty(@Nonnull final T collection, @Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T notEmpty(@Nonnull final T iterable, @Nullable final String name); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T[] notEmpty(@Nonnull final T[] array); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEmptyArgumentException.class }) static T[] notEmpty(@Nonnull final T[] array, @Nullable final String name); @Throws(IllegalEqualException.class) static boolean notEquals(final boolean expected, final boolean check); @Throws(IllegalEqualException.class) static boolean notEquals(final boolean expected, final boolean check, @Nonnull final String message); @Throws(IllegalEqualException.class) static byte notEquals(final byte expected, final byte check); @Throws(IllegalEqualException.class) static byte notEquals(final byte expected, final byte check, @Nonnull final String message); @Throws(IllegalEqualException.class) static char notEquals(final char expected, final char check); @Throws(IllegalEqualException.class) static char notEquals(final char expected, final char check, @Nonnull final String message); @Throws(IllegalEqualException.class) static int notEquals(final int expected, final int check); @Throws(IllegalEqualException.class) static int notEquals(final int expected, final int check, @Nonnull final String message); @Throws(IllegalEqualException.class) static long notEquals(final long expected, final long check); @Throws(IllegalEqualException.class) static long notEquals(final long expected, final long check, @Nonnull final String message); @Throws(IllegalEqualException.class) static short notEquals(final short expected, final short check); @Throws(IllegalEqualException.class) static short notEquals(final short expected, final short check, @Nonnull final String message); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEqualException.class }) static T notEquals(@Nonnull final T expected, @Nonnull final T check); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEqualException.class }) static T notEquals(@Nonnull final T expected, @Nonnull final T check); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEqualException.class }) static T notEquals(@Nonnull final T expected, @Nonnull final T check, @Nonnull final String message); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, IllegalEqualException.class }) static T notEquals(@Nonnull final T expected, @Nonnull final T check, @Nonnull final String message); static T nothing(final T t); @Throws(IllegalNaNArgumentException.class) static double notNaN(final double value); @Throws(IllegalNaNArgumentException.class) static double notNaN(final double value, @Nullable final String name); @Throws(IllegalNaNArgumentException.class) static float notNaN(final float value); @Throws(IllegalNaNArgumentException.class) static float notNaN(final float value, @Nullable final String name); @Throws(IllegalNegativeArgumentException.class) static double notNegative(final double value); @Throws(IllegalNegativeArgumentException.class) static double notNegative(final double value, @Nullable final String name); @Throws(IllegalNegativeArgumentException.class) static float notNegative(final float value); @Throws(IllegalNegativeArgumentException.class) static float notNegative(final float value, @Nullable final String name); @Throws(IllegalNegativeArgumentException.class) static int notNegative(final int value); @Throws(IllegalNegativeArgumentException.class) static int notNegative(final int value, @Nullable final String name); @Throws(IllegalNegativeArgumentException.class) static long notNegative(final long value); @Throws(IllegalNegativeArgumentException.class) static long notNegative(final long value, @Nullable final String name); @Throws(IllegalNegativeArgumentException.class) static short notNegative(final short value); @Throws(IllegalNegativeArgumentException.class) static short notNegative(final short value, @Nullable final String name); @Throws(IllegalNullArgumentException.class) static T notNull(@Nonnull final T reference); @Throws(IllegalNullArgumentException.class) static T notNull(@Nonnull final T reference, @Nullable final String name); @Throws(IllegalPositiveArgumentException.class) static double notPositive(final double value); @Throws(IllegalPositiveArgumentException.class) static double notPositive(final double value, @Nullable final String name); @Throws(IllegalPositiveArgumentException.class) static float notPositive(final float value); @Throws(IllegalPositiveArgumentException.class) static float notPositive(final float value, @Nullable final String name); @Throws(IllegalPositiveArgumentException.class) static int notPositive(final int value); @Throws(IllegalPositiveArgumentException.class) static int notPositive(final int value, @Nullable final String name); @Throws(IllegalPositiveArgumentException.class) static long notPositive(final long value); @Throws(IllegalPositiveArgumentException.class) static long notPositive(final long value, @Nullable final String name); @Throws(IllegalPositiveArgumentException.class) static short notPositive(final short value); @Throws(IllegalPositiveArgumentException.class) static short notPositive(final short value, @Nullable final String name); @Throws(IllegalPositionIndexException.class) static int positionIndex(final int index, final int size); @Throws(IllegalRangeException.class) static void range(@Nonnegative final int start, @Nonnegative final int end, @Nonnegative final int size); @Throws(IllegalStateOfArgumentException.class) static void stateIsTrue(final boolean expression); @ArgumentsChecked @Throws({ IllegalNullArgumentException.class, RuntimeInstantiationException.class }) static void stateIsTrue(final boolean expression, final Class<? extends RuntimeException> clazz); @Throws(IllegalStateOfArgumentException.class) static void stateIsTrue(final boolean expression, @Nonnull final String description); @Throws(IllegalStateOfArgumentException.class) static void stateIsTrue(final boolean expression, @Nonnull final String descriptionTemplate,
			final Object... descriptionTemplateArgs);  }
@Test public void testCheckNothing() { Assert.assertEquals(Integer.valueOf(42), Check.nothing(Integer.valueOf(42))); Assert.assertEquals("qc", Check.nothing("qc")); }
@Test public void testCheckNothingNull() { Assert.assertNull(Check.nothing(null)); }