public <T> void satisfies(AssertionInfo info, List<? extends T> actual, Consumer<? super T> requirements, Index index) { assertNotNull(info, actual); checkNotNull(requirements, "The Consumer expressing the assertions requirements must not be null"); checkIndexValueIsValid(index, actual.size() - 1); requirements.accept(actual.get(index.value)); }
public <T> void satisfies(AssertionInfo info, List<? extends T> actual, Consumer<? super T> requirements, Index index) { assertNotNull(info, actual); checkNotNull(requirements, "The Consumer expressing the assertions requirements must not be null"); checkIndexValueIsValid(index, actual.size() - 1); requirements.accept(actual.get(index.value)); }
private <T> boolean conditionIsMetAtIndex(AssertionInfo info, List<T> actual, Condition<? super T> condition, Index index) { assertNotNull(info, actual); assertNotNull(condition); Iterables.instance().assertNotEmpty(info, actual); checkIndexValueIsValid(index, actual.size() - 1); return condition.matches(actual.get(index.value)); }
/** * Verifies that the given {@code List} does not contain the given object at the given index. * @param info contains information about the assertion. * @param actual the given {@code List}. * @param value the object to look for. * @param index the index where the object should be stored in the given {@code List}. * @throws AssertionError if the given {@code List} is {@code null}. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws AssertionError if the given {@code List} contains the given object at the given index. */ public void assertDoesNotContain(AssertionInfo info, List<?> actual, Object value, Index index) { assertNotNull(info, actual); checkIndexValueIsValid(index, Integer.MAX_VALUE); int indexValue = index.value; if (indexValue >= actual.size()) return; Object actualElement = actual.get(index.value); if (!areEqual(actualElement, value)) return; throw failures.failure(info, shouldNotContainAtIndex(actual, value, index, comparisonStrategy)); }
void assertDoesNotContain(AssertionInfo info, Failures failures, Object array, Object value, Index index) { assertNotNull(info, array); checkIndexValueIsValid(index, Integer.MAX_VALUE); if (index.value >= sizeOf(array)) return; if (areEqual(Array.get(array, index.value), value)) throw failures.failure(info, shouldNotContainAtIndex(array, value, index, comparisonStrategy)); }
void assertContains(AssertionInfo info, Failures failures, Object array, Object value, Index index) { assertNotNull(info, array); assertNotEmpty(info, failures, array); checkIndexValueIsValid(index, sizeOf(array) - 1); Object actualElement = Array.get(array, index.value); if (!areEqual(actualElement, value)) throw failures.failure(info, shouldContainAtIndex(array, value, index, Array.get(array, index.value), comparisonStrategy)); }
/** * Verifies that the given {@code List} does not contain the given object at the given index. * @param info contains information about the assertion. * @param actual the given {@code List}. * @param value the object to look for. * @param index the index where the object should be stored in the given {@code List}. * @throws AssertionError if the given {@code List} is {@code null}. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws AssertionError if the given {@code List} contains the given object at the given index. */ public void assertDoesNotContain(AssertionInfo info, List<?> actual, Object value, Index index) { assertNotNull(info, actual); checkIndexValueIsValid(index, Integer.MAX_VALUE); int indexValue = index.value; if (indexValue >= actual.size()) return; Object actualElement = actual.get(index.value); if (!areEqual(actualElement, value)) return; throw failures.failure(info, shouldNotContainAtIndex(actual, value, index, comparisonStrategy)); }
private <T> boolean conditionIsMetAtIndex(AssertionInfo info, List<T> actual, Condition<? super T> condition, Index index) { assertNotNull(info, actual); assertNotNull(condition); Iterables.instance().assertNotEmpty(info, actual); checkIndexValueIsValid(index, actual.size() - 1); return condition.matches(actual.get(index.value)); }
/** * Verifies that the given {@code List} contains the given object at the given index. * @param info contains information about the assertion. * @param actual the given {@code List}. * @param value the object to look for. * @param index the index where the object should be stored in the given {@code List}. * @throws AssertionError if the given {@code List} is {@code null} or empty. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws IndexOutOfBoundsException if the value of the given {@code Index} is equal to or greater than the size of the given * {@code List}. * @throws AssertionError if the given {@code List} does not contain the given object at the given index. */ public void assertContains(AssertionInfo info, List<?> actual, Object value, Index index) { assertNotNull(info, actual); Iterables.instance().assertNotEmpty(info, actual); checkIndexValueIsValid(index, actual.size() - 1); Object actualElement = actual.get(index.value); if (areEqual(actualElement, value)) return; throw failures.failure(info, shouldContainAtIndex(actual, value, index, actual.get(index.value), comparisonStrategy)); }
void assertContains(AssertionInfo info, Failures failures, Object array, Object value, Index index) { assertNotNull(info, array); assertNotEmpty(info, failures, array); checkIndexValueIsValid(index, sizeOf(array) - 1); Object actualElement = Array.get(array, index.value); if (!areEqual(actualElement, value)) throw failures.failure(info, shouldContainAtIndex(array, value, index, Array.get(array, index.value), comparisonStrategy)); }
void assertDoesNotContain(AssertionInfo info, Failures failures, Object array, Object value, Index index) { assertNotNull(info, array); checkIndexValueIsValid(index, Integer.MAX_VALUE); if (index.value >= sizeOf(array)) return; if (areEqual(Array.get(array, index.value), value)) throw failures.failure(info, shouldNotContainAtIndex(array, value, index, comparisonStrategy)); }
/** * Verifies that the given {@code List} contains the given object at the given index. * @param info contains information about the assertion. * @param actual the given {@code List}. * @param value the object to look for. * @param index the index where the object should be stored in the given {@code List}. * @throws AssertionError if the given {@code List} is {@code null} or empty. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws IndexOutOfBoundsException if the value of the given {@code Index} is equal to or greater than the size of the given * {@code List}. * @throws AssertionError if the given {@code List} does not contain the given object at the given index. */ public void assertContains(AssertionInfo info, List<?> actual, Object value, Index index) { assertNotNull(info, actual); Iterables.instance().assertNotEmpty(info, actual); checkIndexValueIsValid(index, actual.size() - 1); Object actualElement = actual.get(index.value); if (areEqual(actualElement, value)) return; throw failures.failure(info, shouldContainAtIndex(actual, value, index, actual.get(index.value), comparisonStrategy)); }
private <T> boolean conditionIsMetAtIndex(AssertionInfo info, List<T> actual, Condition<? super T> condition, Index index) { assertNotNull(info, actual); assertNotNull(condition); Iterables.instance().assertNotEmpty(info, actual); checkIndexValueIsValid(index, actual.size() - 1); return condition.matches(actual.get(index.value)); }
/** * Verifies that the given {@code List} does not contain the given object at the given index. * @param info contains information about the assertion. * @param actual the given {@code List}. * @param value the object to look for. * @param index the index where the object should be stored in the given {@code List}. * @throws AssertionError if the given {@code List} is {@code null}. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws AssertionError if the given {@code List} contains the given object at the given index. */ public void assertDoesNotContain(AssertionInfo info, List<?> actual, Object value, Index index) { assertNotNull(info, actual); checkIndexValueIsValid(index, Integer.MAX_VALUE); int indexValue = index.value; if (indexValue >= actual.size()) return; Object actualElement = actual.get(index.value); if (!areEqual(actualElement, value)) return; throw failures.failure(info, shouldNotContainAtIndex(actual, value, index, comparisonStrategy)); }
void assertContains(AssertionInfo info, Failures failures, Object array, Object value, Index index) { assertNotNull(info, array); assertNotEmpty(info, failures, array); checkIndexValueIsValid(index, sizeOf(array) - 1); Object actualElement = Array.get(array, index.value); if (!areEqual(actualElement, value)) throw failures.failure(info, shouldContainAtIndex(array, value, index, Array.get(array, index.value), comparisonStrategy)); }
void assertDoesNotContain(AssertionInfo info, Failures failures, Object array, Object value, Index index) { assertNotNull(info, array); checkIndexValueIsValid(index, Integer.MAX_VALUE); if (index.value >= sizeOf(array)) return; if (areEqual(Array.get(array, index.value), value)) throw failures.failure(info, shouldNotContainAtIndex(array, value, index, comparisonStrategy)); }
/** * Verifies that the given {@code List} contains the given object at the given index. * @param info contains information about the assertion. * @param actual the given {@code List}. * @param value the object to look for. * @param index the index where the object should be stored in the given {@code List}. * @throws AssertionError if the given {@code List} is {@code null} or empty. * @throws NullPointerException if the given {@code Index} is {@code null}. * @throws IndexOutOfBoundsException if the value of the given {@code Index} is equal to or greater than the size of the given * {@code List}. * @throws AssertionError if the given {@code List} does not contain the given object at the given index. */ public void assertContains(AssertionInfo info, List<?> actual, Object value, Index index) { assertNotNull(info, actual); Iterables.instance().assertNotEmpty(info, actual); checkIndexValueIsValid(index, actual.size() - 1); Object actualElement = actual.get(index.value); if (areEqual(actualElement, value)) return; throw failures.failure(info, shouldContainAtIndex(actual, value, index, actual.get(index.value), comparisonStrategy)); }