private boolean isOfOneOfGivenTypes(Object actual, Class<?>[] types, AssertionInfo info) { assertNotNull(info, actual); checkNotNull(types, "The given types should not be null"); return isItemInArray(actual.getClass(), types); }
private boolean isOfOneOfGivenTypes(Object actual, Class<?>[] types, AssertionInfo info) { assertNotNull(info, actual); checkNotNull(types, "The given types should not be null"); return isItemInArray(actual.getClass(), types); }
private boolean isOfOneOfGivenTypes(Object actual, Class<?>[] types, AssertionInfo info) { assertNotNull(info, actual); if (types == null) throw new NullPointerException("The given types should not be null"); return isItemInArray(actual.getClass(), types); }
/** * Asserts that the given object is present in the given array. * * @param info contains information about the assertion. * @param actual the given object. * @param values the given array. * @throws NullPointerException if the given array is {@code null}. * @throws IllegalArgumentException if the given array is empty. * @throws AssertionError if the given object is not present in the given array. */ public void assertIsIn(AssertionInfo info, Object actual, Object[] values) { checkIsNotNullAndNotEmpty(values); assertNotNull(info, actual); if (isItemInArray(actual, values)) { return; } throw failures.failure(info, shouldBeIn(actual, values, comparisonStrategy)); }
/** * Asserts that the given object is not present in the given array. * * @param info contains information about the assertion. * @param actual the given object. * @param values the given array. * @throws NullPointerException if the given array is {@code null}. * @throws IllegalArgumentException if the given array is empty. * @throws AssertionError if the given object is present in the given array. */ public void assertIsNotIn(AssertionInfo info, Object actual, Object[] values) { checkIsNotNullAndNotEmpty(values); assertNotNull(info, actual); if (!isItemInArray(actual, values)) { return; } throw failures.failure(info, shouldNotBeIn(actual, values, comparisonStrategy)); }