Top Description Fields Constructors Methods
org.assertj.core.api

public abstract Class AbstractIterableAssert<SELF extends AbstractIterableAssert<SELF, ACTUAL, ELEMENT, ELEMENT_ASSERT>, ACTUAL extends Iterable<? extends ELEMENT>, ELEMENT, ELEMENT_ASSERT extends AbstractAssert<ELEMENT_ASSERT, ELEMENT>>

extends AbstractAssert<SELF extends AbstractIterableAssert<SELF, ACTUAL, ELEMENT, ELEMENT_ASSERT>, ACTUAL extends Iterable<? extends ELEMENT>>
implements ObjectEnumerableAssert<SELF extends AbstractIterableAssert<SELF, ACTUAL, ELEMENT, ELEMENT_ASSERT>, ELEMENT>
Class Inheritance
All Implemented Interfaces
org.assertj.core.api.ObjectEnumerableAssert, org.assertj.core.api.EnumerableAssert
Known Direct Subclasses
org.assertj.core.api.FactoryBasedNavigableIterableAssert, org.assertj.core.api.AbstractCollectionAssert, org.assertj.core.api.ClassBasedNavigableIterableAssert
Annotations
@SuppressWarnings:deprecation
Type Parameters
<SELF>
the "self" type of this assertion class. Please read "Emulating 'self types' using Java Generics to simplify fluent API implementation" for more details.
<ACTUAL>
the type of the "actual" value.
<ELEMENT>
the type of elements of the "actual" value.
<ELEMENT_ASSERT>
used for navigational assertions to return the right assert type.
Static Imports
java.util.Objects.requireNonNull, java.util.stream.Collectors.toList, .StreamSupport.stream, org.assertj.core.api.Assertions.assertThat, org.assertj.core.api.filter.Filters.filter, org.assertj.core.description.Description.mostRelevantDescription, org.assertj.core.error.ShouldNotBeNull.shouldNotBeNull, org.assertj.core.extractor.Extractors.byName, .Extractors.extractedDescriptionOf, .Extractors.extractedDescriptionOfMethod, .Extractors.resultOf, org.assertj.core.internal.CommonValidations.checkSequenceIsNotNull, .CommonValidations.checkSubsequenceIsNotNull, .Iterables.byPassingAssertions, .TypeComparators.defaultTypeComparators, org.assertj.core.util.Arrays.isArray, .IterableUtil.toArray, .Lists.newArrayList, .Preconditions.checkArgument, .Preconditions.checkNotNull

Base class for implementations of ObjectEnumerableAssert whose actual value type is Collection.
Authors
Yvonne Wang, Alex Ruiz, Mathieu Baechler, Joel Costigliola, Maciej Jaskowski, Nicolas François, Mikhail Mazursky, Mateusz Haligowski, Lovro Pandzic, Marko Bekhta

Field Summary

Modifier and TypeField and Description
private static final String
private TypeComparators
private Map<String, Comparator<?>>
private TypeComparators
protected Iterables
Inherited from org.assertj.core.api.AbstractAssert:
actualassertionErrorCreatorconditionscustomRepresentationinfomyselfobjectsprintAssertionsDescriptionthrowUnsupportedExceptionOnEquals

Constructor Summary

AccessConstructor and Description
protected
AbstractIterableAssert(ACTUAL actual, Class<?> selfType)

Method Summary

Modifier and TypeMethod and Description
public SELF
allMatch(Predicate<? super ELEMENT>
the given Predicate.
predicate
)

Implements org.assertj.core.api.ObjectEnumerableAssert.allMatch.

Verifies that all the elements of actual match the given Predicate.
public SELF
allMatch(Predicate<? super ELEMENT>
the given Predicate.
predicate
,
String
a description of the Predicate used in the error message
predicateDescription
)

Implements org.assertj.core.api.ObjectEnumerableAssert.allMatch.

Verifies that all the elements of actual match the given Predicate.
public SELF
allSatisfy(Consumer<? super ELEMENT>
the given Consumer.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.allSatisfy.

Verifies that all the elements satisfy the given requirements expressed as a Consumer.
public SELF
allSatisfy(ThrowingConsumer<? super ELEMENT>
the given ThrowingConsumer.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.allSatisfy.

Verifies that all the elements satisfy the given requirements expressed as a ThrowingConsumer.
public SELF
anyMatch(Predicate<? super ELEMENT>
the given Predicate.
predicate
)

Implements org.assertj.core.api.ObjectEnumerableAssert.anyMatch.

Verifies whether any elements match the provided Predicate.
public SELF
anySatisfy(Consumer<? super ELEMENT>
the given Consumer.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.anySatisfy.

Verifies that at least one element satisfies the given requirements expressed as a Consumer.
public SELF
anySatisfy(ThrowingConsumer<? super ELEMENT>
the given ThrowingConsumer.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.anySatisfy.

Verifies that at least one element satisfies the given requirements expressed as a ThrowingConsumer.
public SELF
are(Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.are.

Verifies that each element value satisfies the given condition.
public SELF
areAtLeast(int
the minimum number of times the condition should be verified.
times
,
Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.areAtLeast.

Verifies that there are at least n elements in the actual group satisfying the given condition.
public SELF
areAtLeastOne(Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.areAtLeastOne.

Verifies that there is at least one element in the actual group satisfying the given condition.
public SELF
areAtMost(int
the number of times the condition should be at most verified.
times
,
Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.areAtMost.

Verifies that there are at most n elements in the actual group satisfying the given condition.
public SELF
areExactly(int
the exact number of times the condition should be verified.
times
,
Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.areExactly.

Verifies that there are exactly n elements in the actual group satisfying the given condition.
public SELF
areNot(Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.areNot.

Verifies that each element value does not satisfy the given condition.
public SELF
as(String
the new description to set.
description
,
Object...
optional parameter if description is a format String.
args
)

Overrides default org.assertj.core.api.Descriptable.as.

Sets the description of the assertion that is going to be called after.
public SELF
as(Description
the new description to set.
description
)

Overrides default org.assertj.core.api.Descriptable.as.

Sets the description of the assertion that is going to be called after.
private static void
assertIndicesIsNotEmpty(int[] indices)

private static void
assertIndicesIsNotNull(int[] indices)

private void
checkIndexValidity(int index, List<ELEMENT> indexedActual)

public final SELF
contains(ELEMENT...
the given values.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.contains.

Verifies that the actual group contains the given values, in any order.
public SELF
containsAll(Iterable<? extends ELEMENT>
the given Iterable we will get elements from.
iterable
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsAll.

Verifies that the actual group contains all the elements of given Iterable, in any order.
public SELF

Returns:

this assertion object.
containsAnyElementsOf
(Iterable<? extends ELEMENT>
the iterable whose at least one element is expected to be in the Iterable under test.
iterable
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsAnyElementsOf.

Verifies that the Iterable under test contains at least one of the given Iterable elements.
public final SELF

Returns:

this assertion object.
containsAnyOf
(ELEMENT...
the values whose at least one which is expected to be in the Iterable under test.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsAnyOf.

Verifies that the actual Iterable contains at least one of the given values.
protected SELF
containsAnyOfForProxy(ELEMENT[] values)

public final SELF
containsExactly(ELEMENT...
the given values.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsExactly.

Verifies that the actual group contains exactly the given values and nothing else, in order.
public SELF
containsExactlyElementsOf(Iterable<? extends ELEMENT>
the given Iterable we will get elements from.
iterable
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsExactlyElementsOf.

Same as containsExactly(Object...) but handle the Iterable to array conversion : verifies that actual contains exactly the elements of the given iterable and nothing else in the same order.
protected SELF
containsExactlyForProxy(ELEMENT[] values)

public final SELF
containsExactlyInAnyOrder(ELEMENT...
the given values.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsExactlyInAnyOrder.

Verifies that the actual group contains exactly the given values and nothing else, in any order.
public SELF
containsExactlyInAnyOrderElementsOf(Iterable<? extends ELEMENT>
the given values.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsExactlyInAnyOrderElementsOf.

Verifies that the actual group contains exactly the given values and nothing else, in any order.
protected SELF
protected SELF
containsForProxy(ELEMENT[] values)

public SELF
containsNull()

Implements org.assertj.core.api.ObjectEnumerableAssert.containsNull.

Verifies that the actual group contains at least a null element.
public final SELF
containsOnly(ELEMENT...
the given values.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsOnly.

Verifies that the actual group contains only the given values and nothing else, in any order and ignoring duplicates (i.e. once a value is found, its duplicates are also considered found).
public SELF
containsOnlyElementsOf(Iterable<? extends ELEMENT>
the given Iterable we will get elements from.
iterable
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsOnlyElementsOf.

Deprecated
Same semantic as containsOnly(Object[]) : verifies that actual contains all the elements of the given iterable and nothing else, in any order and ignoring duplicates (i.e. once a value is found, its duplicates are also considered found).
protected SELF
containsOnlyForProxy(ELEMENT[] values)

public SELF
containsOnlyNulls()

Implements org.assertj.core.api.ObjectEnumerableAssert.containsOnlyNulls.

Verifies that the actual group contains only null elements and nothing else.
public final SELF
containsOnlyOnce(ELEMENT...
the given values.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsOnlyOnce.

Verifies that the actual group contains the given values only once.
public SELF
containsOnlyOnceElementsOf(Iterable<? extends ELEMENT>
the given Iterable we will get elements from.
iterable
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsOnlyOnceElementsOf.

Same semantic as containsOnlyOnce(Object...) : verifies that the actual group contains the elements of the given iterable only once.
protected SELF
containsOnlyOnceForProxy(ELEMENT[] values)

public final SELF
containsSequence(ELEMENT...
the sequence of objects to look for.
sequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsSequence.

Verifies that the actual group contains the given sequence in the correct order and without extra values between the sequence values.
public SELF
containsSequence(Iterable<? extends ELEMENT>
the sequence of objects to look for.
sequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsSequence.

Verifies that the actual group contains the given sequence in the correct order and without extra values between the sequence values.
protected SELF
containsSequenceForProxy(ELEMENT[] sequence)

public final SELF
containsSubsequence(ELEMENT...
the sequence of objects to look for.
subsequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsSubsequence.

Verifies that the actual group contains the given subsequence in the correct order (possibly with other values between them).
public SELF
containsSubsequence(Iterable<? extends ELEMENT>
the sequence of objects to look for.
subsequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.containsSubsequence.

Verifies that the actual group contains the given subsequence in the correct order (possibly with other values between them).
protected SELF
containsSubsequenceForProxy(ELEMENT[] subsequence)

public SELF
describedAs(Description
the new description to set.
description
)

Overrides org.assertj.core.api.AbstractAssert.describedAs.

Implements org.assertj.core.api.Descriptable.describedAs.

Sets the description of the assertion that is going to be called after.
public SELF
describedAs(String
the new description to set.
description
,
Object...
optional parameter if description is a format String.
args
)

Overrides default org.assertj.core.api.Descriptable.describedAs.

Sets the description of the assertion that is going to be called after.
public final SELF
doesNotContain(ELEMENT...
the given values.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.doesNotContain.

Verifies that the actual group does not contain the given values.
public SELF
doesNotContainAnyElementsOf(Iterable<? extends ELEMENT>
the Iterable whose elements must not be in the actual group.
iterable
)

Implements org.assertj.core.api.ObjectEnumerableAssert.doesNotContainAnyElementsOf.

Verifies that actual does not contain any elements of the given Iterable (i.e. none).
protected SELF
doesNotContainForProxy(ELEMENT[] values)

public SELF
doesNotContainNull()

Implements org.assertj.core.api.ObjectEnumerableAssert.doesNotContainNull.

Verifies that the actual group does not contain null elements.
public final SELF
doesNotContainSequence(ELEMENT...
the sequence of objects to look for.
sequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.doesNotContainSequence.

Verifies that the actual group does not contain the given sequence, a sequence is defined by an ordered group of values without extra values between them.
public SELF
doesNotContainSequence(Iterable<? extends ELEMENT>
the sequence of objects to look for.
sequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.doesNotContainSequence.

Verifies that the actual group does not contain the given sequence, a sequence is defined by an ordered group of values without extra values between them.
protected SELF
doesNotContainSequenceForProxy(ELEMENT[] sequence)

public final SELF
doesNotContainSubsequence(ELEMENT...
the sequence of objects to look for.
subsequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.doesNotContainSubsequence.

Verifies that the actual group does not contain the given subsequence, a subsequence is defined by an ordered group of values with possibly extra values between them.
public SELF
doesNotContainSubsequence(Iterable<? extends ELEMENT>
the sequence of objects to look for.
subsequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.doesNotContainSubsequence.

Verifies that the actual group does not contain the given subsequence, a subsequence is defined by an ordered group of values with possibly extra values between them.
protected SELF
doesNotContainSubsequenceForProxy(ELEMENT[] subsequence)

public SELF
doesNotHave(Condition<? super ACTUAL>
the given condition.
condition
)

Overrides org.assertj.core.api.AbstractAssert.doesNotHave.

Implements org.assertj.core.api.ExtensionPoints.doesNotHave.

Verifies that the actual value does not satisfy the given condition.
public SELF

Returns:

this assertion object.
doesNotHaveAnyElementsOfTypes
(Class<?>...
the not expected types.
unexpectedTypes
)

Implements org.assertj.core.api.ObjectEnumerableAssert.doesNotHaveAnyElementsOfTypes.

Verifies that all elements in the actual Iterable do not have the specified types (including subclasses).
public SELF
doesNotHaveDuplicates()

Implements org.assertj.core.api.ObjectEnumerableAssert.doesNotHaveDuplicates.

Verifies that the actual group does not contain duplicates.
public SELF
doesNotHaveSameClassAs(Object
the object to check type against.
other
)

Overrides org.assertj.core.api.AbstractAssert.doesNotHaveSameClassAs.

Implements org.assertj.core.api.Assert.doesNotHaveSameClassAs.

Verifies that the actual value does not have the same class as the given object.
private <V> AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>
doFlatExtracting(Function<? super ELEMENT, ? extends Collection<V>> extractor)

public SELF
doNotHave(Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.doNotHave.

Verifies that all elements do not satisfy the given condition.
public ELEMENT_ASSERT

Returns:

the assertion on the given element
element
(int
the element's index
index
)

Navigate and allow to perform assertions on the chosen element of the Iterable under test.

public <
the type of the resulting Assert
ASSERT extends AbstractAssert<?, ?>
>
ASSERT

Returns:

a new narrowed Assert instance for assertions chaining on the element at the given index
element
(int
the element's index
index
,
InstanceOfAssertFactory<?, ASSERT>
the factory which verifies the type and creates the new Assert
assertFactory
)

Navigate and allow to perform assertions on the chosen element of the Iterable under test.

public SELF

Returns:

the assertion on the given elements
elements
(int...
the elements indices
indices
)

Allow to perform assertions on the elements corresponding to the given indices (the iterable Iterable under test is changed to an iterable with the selected elements).

public final SELF
endsWith(ELEMENT
the first element of the sequence of objects to look for.
first
,
ELEMENT...
the rest of the sequence of objects to look for.
rest
)

Implements org.assertj.core.api.ObjectEnumerableAssert.endsWith.

Verifies that the actual group ends with the given sequence of objects, without any other objects between them.
public SELF
endsWith(ELEMENT[]
the sequence of objects to look for.
sequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.endsWith.

Verifies that the actual group ends with the given sequence of objects, without any other objects between them.
protected SELF
endsWithForProxy(ELEMENT first, ELEMENT[] rest)

public AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>>

Returns:

a new assertion object whose object under test is the list of extracted property/field values.
extracting
(String
the property/field to extract from the elements of the Iterable under test
propertyOrField
)

Extract the values of the given field or property from the Iterable's elements under test into a new Iterable, this new Iterable becoming the Iterable under test.

public <
the type of elements extracted.
P
>
AbstractListAssert<?, List<? extends P>, P, ObjectAssert<P>>

Returns:

a new assertion object whose object under test is the list of extracted property/field values.
extracting
(String
the property/field to extract from the Iterable under test
propertyOrField
,
Class<P>
type to return
extractingType
)

Extract the values of given field or property from the Iterable's elements under test into a new Iterable, this new Iterable becoming the Iterable under test.

public AbstractListAssert<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>>

Returns:

a new assertion object whose object under test is the list of Tuple with extracted properties/fields values as data.
extracting
(String...
the properties/fields to extract from the elements of the Iterable under test
propertiesOrFields
)

Extract the values of the given fields/properties from the Iterable's elements under test into a new Iterable composed of Tuples (a simple data structure), this new Iterable becoming the Iterable under test.

public <
the type of elements extracted.
V
>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>

Returns:

a new assertion object whose object under test is the list of values extracted
extracting
(Function<? super ELEMENT, V>
the object transforming input object to desired one
extractor
)

Extract the values from Iterable's elements under test by applying an extracting function on them.

public <
the type of elements extracted.
V
,
the exception type of ThrowingExtractor
EXCEPTION extends Exception
>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>

Returns:

a new assertion object whose object under test is the list of values extracted
extracting
(ThrowingExtractor<? super ELEMENT, V, EXCEPTION>
the object transforming input object to desired one
extractor
)

Extract the values from Iterable's elements under test by applying an extracting function (which might throw an exception) on them.

public final AbstractListAssert<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>>

Returns:

a new assertion object whose object under test is the list of Tuples containing the extracted values.
extracting
(Function<? super ELEMENT, ?>...
the extractor functions to extract a value from an element of the Iterable under test.
extractors
)

Use the given Functions to extract the values from the Iterable's elements into a new Iterable composed of Tuples (a simple data structure containing the extracted values), this new Iterable becoming the object under test.

protected AbstractListAssert<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>>
extractingForProxy(Function<? super ELEMENT, ?>[] extractors)

public AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>>

Returns:

a new assertion object whose object under test is the Iterable of extracted values.
extractingResultOf
(String
the name of the method which result is to be extracted from the array under test
method
)

Extract the result of given method invocation on the Iterable's elements under test into a new Iterable, this new Iterable becoming the Iterable under test.

public <
the type of elements extracted.
P
>
AbstractListAssert<?, List<? extends P>, P, ObjectAssert<P>>

Returns:

a new assertion object whose object under test is the Iterable of extracted values.
extractingResultOf
(String
the name of the method which result is to be extracted from the array under test
method
,
Class<P>
type of element of the extracted List
extractedType
)

Extract the result of given method invocation on the Iterable's elements under test into a new list of the given class, this new List becoming the object under test.

public SELF

Returns:

a new assertion object with the filtered iterable under test
filteredOn
(String
the name of the property or field to read
propertyOrFieldName
,
Object
the value to compare element's property or field with
expectedValue
)

Filters the iterable under test keeping only elements having a property or field equal to expectedValue, the property/field is specified by propertyOrFieldName parameter.

public SELF

Returns:

a new assertion object with the filtered iterable under test
filteredOn
(String
the name of the property or field to read
propertyOrFieldName
,
FilterOperator<?>
the filter operator to apply
filterOperator
)

Filters the iterable under test keeping only elements having a property or field matching the filter expressed with the FilterOperator, the property/field is specified by propertyOrFieldName parameter.

public SELF

Returns:

a new assertion object with the filtered iterable under test
filteredOn
(Condition<? super ELEMENT>
the filter condition / predicate
condition
)

Filters the iterable under test keeping only elements matching the given Condition.

public <
result type of the filter function
T
>
SELF

Returns:

a new assertion object with the filtered iterable under test
filteredOn
(Function<? super ELEMENT, T>
the filter function
function
,
T
the expected value of the filter function
expectedValue
)

Filters the iterable under test keeping only elements for which the result of the function is equal to expectedValue.

public SELF

Returns:

a new assertion object with the filtered iterable under test
filteredOn
(Predicate<? super ELEMENT>
the filter predicate
predicate
)

Filters the iterable under test keeping only elements matching the given Predicate.

public SELF

Returns:

a new assertion object with the filtered iterable under test
filteredOnAssertions
(Consumer<? super ELEMENT>
containing AssertJ assertions to filter on
elementAssertions
)

Filters the iterable under test keeping only elements matching the given assertions specified with a Consumer.

public SELF

Returns:

a new assertion object with the filtered iterable under test
filteredOnAssertions
(ThrowingConsumer<? super ELEMENT>
containing AssertJ assertions to filter on
elementAssertions
)

Filters the iterable under test keeping only elements matching the given assertions specified with a ThrowingConsumer.

public SELF

Returns:

a new assertion object with the filtered iterable under test
filteredOnNull
(String
the name of the property or field to read
propertyOrFieldName
)

Filters the iterable under test keeping only elements whose property or field specified by propertyOrFieldName is null.

public ELEMENT_ASSERT

Returns:

the assertion on the first element
first
()

Navigate and allow to perform assertions on the first element of the Iterable under test.

public <
the type of the resulting Assert
ASSERT extends AbstractAssert<?, ?>
>
ASSERT

Returns:

a new narrowed Assert instance for assertions chaining on the first element
first
(InstanceOfAssertFactory<?, ASSERT>
the factory which verifies the type and creates the new Assert
assertFactory
)

Navigate and allow to perform assertions on the first element of the Iterable under test.

public <
the type of extracted elements.
V
>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>

Returns:

a new assertion object whose object under test is the list of values extracted
flatExtracting
(Function<? super ELEMENT, ? extends Collection<V>>
the Function transforming input object to an Iterable of desired ones
extractor
)

Extracts Iterable elements values by applying a function and concatenates the result into a list that becomes the instance under test.

public <
the type of extracted values.
V
,
the exception type of ThrowingExtractor
EXCEPTION extends Exception
>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>

Returns:

a new assertion object whose object under test is the list of values extracted
flatExtracting
(ThrowingExtractor<? super ELEMENT, ? extends Collection<V>, EXCEPTION>
the object transforming input object to an Iterable of desired ones
extractor
)

Extracts Iterable elements values by applying a function (which might throw a checked exception) on them and concatenates/flattens the result into a single list that becomes the instance under test.

public final AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>>

Returns:

a new assertion object whose object under test is a flattened list of all extracted values.
flatExtracting
(Function<? super ELEMENT, ?>...
all the extractors to apply on each actual Iterable's elements
extractors
)

Extracts multiple values from each Iterable's element according to the given Functions and concatenates/flattens them in a list that becomes the instance under test.

public final <
the exception type of ThrowingExtractor
EXCEPTION extends Exception
>
AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>>

Returns:

a new assertion object whose object under test is a flattened list of all extracted values.
flatExtracting
(ThrowingExtractor<? super ELEMENT, ?, EXCEPTION>...
all the extractors to apply on each actual Iterable's elements
extractors
)

Extracts multiple values from each Iterable's element according to the given ThrowingExtractors and concatenates/flattens them in a list that becomes the object under test.

public AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>>

Returns:

a new assertion object whose object under test is the list of values extracted
flatExtracting
(String
the object transforming input object to an Iterable of desired ones
fieldOrPropertyName
)

Extract Iterable's elements values corresponding to the given property/field name and concatenates them into a list becoming the new instance under test.

public AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>>

Returns:

a new assertion object whose object under test is a flattened list of all extracted values.
flatExtracting
(String...
the field and/or property names to extract from each actual Iterable's element
fieldOrPropertyNames
)

Extract the given property/field values from each Iterable's element and flatten the extracted values in a list that is used as the new object under test.

protected AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>>
flatExtractingForProxy(Function<? super ELEMENT, ?>[] extractors)

public <
the type of mapped elements.
V
>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>

Returns:

a new assertion object whose object under test is the list of values extracted
flatMap
(Function<? super ELEMENT, ? extends Collection<V>>
the Function transforming input object to an Iterable of desired ones
mapper
)

Maps the Iterable's elements under test by applying the given Function and flattens the resulting collections in a list becoming the object under test.

public <
the type of mapped values.
V
,
the exception type of ThrowingExtractor
EXCEPTION extends Exception
>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>

Returns:

a new assertion object whose object under test is the list of values extracted
flatMap
(ThrowingExtractor<? super ELEMENT, ? extends Collection<V>, EXCEPTION>
the object transforming input object to an Iterable of desired ones
mapper
)

Maps the Iterable's elements under test by applying a mapping function (which might throw a checked exception) and concatenates/flattens the result into a single list that becomes the instance under test.

public final AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>>

Returns:

a new assertion object whose object under test is a flattened list of all mapped values.
flatMap
(Function<? super ELEMENT, ?>...
all the mappers to apply on each actual Iterable's elements
mappers
)

Maps multiple values from each Iterable's element according to the given Functions and concatenates/flattens them in a list that becomes the instance under test.

public final <
the exception type of ThrowingExtractor
EXCEPTION extends Exception
>
AbstractListAssert<?, List<? extends Object>, Object, ObjectAssert<Object>>

Returns:

a new assertion object whose object under test is a flattened list of all extracted values.
flatMap
(ThrowingExtractor<? super ELEMENT, ?, EXCEPTION>...
all the mappers to apply on each actual Iterable's elements
mappers
)

Maps multiple values from each Iterable's element according to the given ThrowingExtractors and concatenates/flattens them in a list that becomes the object under test.

protected TypeComparators
protected TypeComparators
public SELF
has(Condition<? super ACTUAL>
the given condition.
condition
)

Overrides org.assertj.core.api.AbstractAssert.has.

Implements org.assertj.core.api.ExtensionPoints.has.

Verifies that the actual value satisfies the given condition.
public SELF

Returns:

this assertion object.
hasAtLeastOneElementOfType
(Class<?>
the expected type.
expectedType
)

Implements org.assertj.core.api.ObjectEnumerableAssert.hasAtLeastOneElementOfType.

Verifies that at least one element in the actual Iterable has the specified type (matching includes subclasses of the given type).
public SELF
hasExactlyElementsOfTypes(Class<?>...
the expected types
types
)

Implements org.assertj.core.api.ObjectEnumerableAssert.hasExactlyElementsOfTypes.

Verifies that the actual elements are of the given types in the given order, there should be as many expected types as there are actual elements.
public SELF

Returns:

this assertion object.
hasOnlyElementsOfType
(Class<?>
the expected type.
expectedType
)

Implements org.assertj.core.api.ObjectEnumerableAssert.hasOnlyElementsOfType.

Verifies that all elements in the actual Iterable have the specified type (matching includes subclasses of the given type).
public SELF
hasOnlyElementsOfTypes(Class<?>...
the expected types
types
)

Implements org.assertj.core.api.ObjectEnumerableAssert.hasOnlyElementsOfTypes.

Verifies that all elements of the actual group are instances of the given types.
public SELF
hasOnlyOneElementSatisfying(Consumer<? super ELEMENT>
the assertions to perform on the unique element.
elementAssertions
)

Implements org.assertj.core.api.ObjectEnumerableAssert.hasOnlyOneElementSatisfying.

Deprecated use singleElement() instead
Verifies that the unique element of the Iterable satisfies the given assertions expressed as a Consumer, if it does not, only the first error is reported, use SoftAssertions to get all the errors.
public SELF
hasSameClassAs(Object
the object to check type against.
other
)

Overrides org.assertj.core.api.AbstractAssert.hasSameClassAs.

Implements org.assertj.core.api.Assert.hasSameClassAs.

Verifies that the actual value has the same class as the given object.
public SELF
hasSameElementsAs(Iterable<? extends ELEMENT>
the Iterable whose elements we expect to be present
iterable
)

Implements org.assertj.core.api.ObjectEnumerableAssert.hasSameElementsAs.

Verifies that actual contains all the elements of the given iterable and nothing else, in any order and ignoring duplicates (i.e. once a value is found, its duplicates are also considered found).
public SELF
hasSameSizeAs(Object
the array to compare size with actual group.
other
)

Implements org.assertj.core.api.EnumerableAssert.hasSameSizeAs.

Verifies that the actual group has the same size as given array.
public SELF
hasSameSizeAs(Iterable<?>
the Iterable to compare size with actual group.
other
)

Implements org.assertj.core.api.EnumerableAssert.hasSameSizeAs.

Verifies that the actual group has the same size as given Iterable.
public SELF
hasSize(int
the expected number of values in the actual group.
expected
)

Implements org.assertj.core.api.EnumerableAssert.hasSize.

Verifies that the number of values in the actual group is equal to the given one.
public SELF

Returns:

this assertion object.
hasSizeBetween
(int
the lower boundary compared to which actual size should be greater than or equal to.
lowerBoundary
,
int
the higher boundary compared to which actual size should be less than or equal to.
higherBoundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeBetween.

Verifies that the number of values in the actual iterable is between the given boundaries (inclusive).
public SELF

Returns:

this assertion object.
hasSizeGreaterThan
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeGreaterThan.

Verifies that the number of values in the actual iterable is greater than the given boundary.
public SELF

Returns:

this assertion object.
hasSizeGreaterThanOrEqualTo
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeGreaterThanOrEqualTo.

Verifies that the number of values in the actual iterable is greater than or equal to the given boundary.
public SELF

Returns:

this assertion object.
hasSizeLessThan
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeLessThan.

Verifies that the number of values in the actual iterable is less than the given boundary.
public SELF

Returns:

this assertion object.
hasSizeLessThanOrEqualTo
(int
the given value to compare the actual size to.
boundary
)

Implements org.assertj.core.api.EnumerableAssert.hasSizeLessThanOrEqualTo.

Verifies that the number of values in the actual iterable is less than or equal to the given boundary.
public SELF
hasToString(String
the expected String description of actual.
expectedToString
)

Overrides org.assertj.core.api.AbstractAssert.hasToString.

Implements org.assertj.core.api.Assert.hasToString.

Verifies that actual actual.toString() is equal to the given String.
public SELF
have(Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.have.

Verifies that all elements satisfy the given condition.
public SELF
haveAtLeast(int
the minimum number of times the condition must hold.
times
,
Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.haveAtLeast.

Verifies that there are at least n elements in the actual group satisfying the given condition.
public SELF
haveAtLeastOne(Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.haveAtLeastOne.

Verifies that there is at least one element in the actual group satisfying the given condition.
public SELF
haveAtMost(int
the maximum number of times the condition must hold.
times
,
Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.haveAtMost.

Verifies that there are at most n elements in the actual group satisfying the given condition.
public SELF
haveExactly(int
the exact number of times the condition must hold.
times
,
Condition<? super ELEMENT>
the given condition.
condition
)

Implements org.assertj.core.api.ObjectEnumerableAssert.haveExactly.

Verifies that there are exactly n elements in the actual group satisfying the given condition.
public SELF

Returns:

this assertion object.
inBinary
()

Overrides org.assertj.core.api.AbstractAssert.inBinary.

Enable binary representation of Iterable elements instead of standard representation in error messages.
public SELF

Returns:

this assertion object.
inHexadecimal
()

Overrides org.assertj.core.api.AbstractAssert.inHexadecimal.

Enable hexadecimal representation of Iterable elements instead of standard representation in error messages.
private SELF
internalAllSatisfy(Consumer<? super ELEMENT> requirements)

private SELF
internalAnySatisfy(Consumer<? super ELEMENT> requirements)

private ELEMENT_ASSERT
internalElement(int index)

private <V> AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>
internalExtracting(Function<? super ELEMENT, V> extractor)

private SELF
internalFilteredOn(Predicate<? super ELEMENT> predicate)

private SELF
internalFilteredOnAssertions(Consumer<? super ELEMENT> elementAssertions)

private ELEMENT_ASSERT
private ELEMENT_ASSERT
private SELF
internalNoneSatisfy(Consumer<? super ELEMENT> restrictions)

private ELEMENT_ASSERT
public SELF
is(Condition<? super ACTUAL>
the given condition.
condition
)

Overrides org.assertj.core.api.AbstractAssert.is.

Implements org.assertj.core.api.ExtensionPoints.is.

Verifies that the actual value satisfies the given condition.
public void
isEmpty()

Implements org.assertj.core.api.EnumerableAssert.isEmpty.

Verifies that the actual group of values is empty.
public SELF
isEqualTo(Object
the given value to compare the actual value to.
expected
)

Overrides org.assertj.core.api.AbstractAssert.isEqualTo.

Implements org.assertj.core.api.Assert.isEqualTo.

Verifies that the actual value is equal to the given one.
public SELF
isExactlyInstanceOf(Class<?>
the type to check the actual value against.
type
)

Overrides org.assertj.core.api.AbstractAssert.isExactlyInstanceOf.

Implements org.assertj.core.api.Assert.isExactlyInstanceOf.

Verifies that the actual value is exactly an instance of the given type.
public SELF
isIn(Iterable<?>
the given iterable to search the actual value in.
values
)

Overrides org.assertj.core.api.AbstractAssert.isIn.

Implements org.assertj.core.api.Assert.isIn.

Verifies that the actual value is present in the given iterable.
public SELF
isIn(Object...
the given array to search the actual value in.
values
)

Overrides org.assertj.core.api.AbstractAssert.isIn.

Implements org.assertj.core.api.Assert.isIn.

Verifies that the actual value is present in the given array of values.
public SELF
isInstanceOf(Class<?>
the type to check the actual value against.
type
)

Overrides org.assertj.core.api.AbstractAssert.isInstanceOf.

Implements org.assertj.core.api.Assert.isInstanceOf.

Verifies that the actual value is an instance of the given type.
public SELF
isInstanceOfAny(Class<?>...
the types to check the actual value against.
types
)

Overrides org.assertj.core.api.AbstractAssert.isInstanceOfAny.

Implements org.assertj.core.api.Assert.isInstanceOfAny.

Verifies that the actual value is an instance of any of the given types.
public SELF
isNot(Condition<? super ACTUAL>
the given condition.
condition
)

Overrides org.assertj.core.api.AbstractAssert.isNot.

Implements org.assertj.core.api.ExtensionPoints.isNot.

Verifies that the actual value does not satisfy the given condition.
public SELF
isNotEmpty()

Implements org.assertj.core.api.EnumerableAssert.isNotEmpty.

Verifies that the actual group of values is not empty.
public SELF
isNotEqualTo(Object
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractAssert.isNotEqualTo.

Implements org.assertj.core.api.Assert.isNotEqualTo.

Verifies that the actual value is not equal to the given one.
public SELF
isNotExactlyInstanceOf(Class<?>
the type to check the actual value against.
type
)

Overrides org.assertj.core.api.AbstractAssert.isNotExactlyInstanceOf.

Implements org.assertj.core.api.Assert.isNotExactlyInstanceOf.

Verifies that the actual value is not exactly an instance of given type.
public SELF
isNotIn(Iterable<?>
the given iterable to search the actual value in.
values
)

Overrides org.assertj.core.api.AbstractAssert.isNotIn.

Implements org.assertj.core.api.Assert.isNotIn.

Verifies that the actual value is not present in the given iterable.
public SELF
isNotIn(Object...
the given array to search the actual value in.
values
)

Overrides org.assertj.core.api.AbstractAssert.isNotIn.

Implements org.assertj.core.api.Assert.isNotIn.

Verifies that the actual value is not present in the given array of values.
public SELF
isNotInstanceOf(Class<?>
the type to check the actual value against.
type
)

Overrides org.assertj.core.api.AbstractAssert.isNotInstanceOf.

Implements org.assertj.core.api.Assert.isNotInstanceOf.

Verifies that the actual value is not an instance of the given type.
public SELF
isNotInstanceOfAny(Class<?>...
the types to check the actual value against.
types
)

Overrides org.assertj.core.api.AbstractAssert.isNotInstanceOfAny.

Implements org.assertj.core.api.Assert.isNotInstanceOfAny.

Verifies that the actual value is not an instance of any of the given types.
public SELF
isNotNull()

Overrides org.assertj.core.api.AbstractAssert.isNotNull.

Implements org.assertj.core.api.Assert.isNotNull.

Verifies that the actual value is not null.
public SELF
isNotOfAnyClassIn(Class<?>...
the types to check the actual value against.
types
)

Overrides org.assertj.core.api.AbstractAssert.isNotOfAnyClassIn.

Implements org.assertj.core.api.Assert.isNotOfAnyClassIn.

Verifies that the actual value type is not in given types.
public SELF
isNotSameAs(Object
the given value to compare the actual value to.
other
)

Overrides org.assertj.core.api.AbstractAssert.isNotSameAs.

Implements org.assertj.core.api.Assert.isNotSameAs.

Verifies that the actual value is not the same as the given one, i.e., using == comparison.
public void
isNullOrEmpty()

Implements org.assertj.core.api.EnumerableAssert.isNullOrEmpty.

Verifies that the actual group of values is null or empty.
public SELF
isOfAnyClassIn(Class<?>...
the types to check the actual value against.
types
)

Overrides org.assertj.core.api.AbstractAssert.isOfAnyClassIn.

Implements org.assertj.core.api.Assert.isOfAnyClassIn.

Verifies that the actual value type is in given types.
public SELF
isSameAs(Object
the given value to compare the actual value to.
expected
)

Overrides org.assertj.core.api.AbstractAssert.isSameAs.

Implements org.assertj.core.api.Assert.isSameAs.

Verifies that the actual value is the same as the given one, i.e., using == comparison.
public SELF
isSubsetOf(Iterable<? extends ELEMENT>
the Iterable that should contain all actual elements.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.isSubsetOf.

Verifies that all the elements of actual are present in the given Iterable.
public final SELF
isSubsetOf(ELEMENT...
the values that should be used for checking the elements of actual.
values
)

Implements org.assertj.core.api.ObjectEnumerableAssert.isSubsetOf.

Verifies that all the elements of actual are present in the given values.
protected SELF
isSubsetOfForProxy(ELEMENT[] values)

public ELEMENT_ASSERT

Returns:

the assertion on the last element
last
()

Navigate and allow to perform assertions on the last element of the Iterable under test.

public <
the type of the resulting Assert
ASSERT extends AbstractAssert<?, ?>
>
ASSERT

Returns:

a new narrowed Assert instance for assertions chaining on the last element
last
(InstanceOfAssertFactory<?, ASSERT>
the factory which verifies the type and creates the new Assert
assertFactory
)

Navigate and allow to perform assertions on the last element of the Iterable under test.

private ELEMENT
public <
the type of elements resulting of the map operation.
V
>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>

Returns:

a new assertion object whose object under test is the list of values extracted
map
(Function<? super ELEMENT, V>
the Function transforming input object to desired one
mapper
)

Maps the Iterable's elements under test by applying a mapping function, the resulting list becomes the instance under test.

public <
the type of elements extracted.
V
,
the exception type of ThrowingExtractor
EXCEPTION extends Exception
>
AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>

Returns:

a new assertion object whose object under test is the list of values extracted
map
(ThrowingExtractor<? super ELEMENT, V, EXCEPTION>
the function transforming input object to desired one
mapper
)

Maps the Iterable's elements by applying the given mapping function (which might throw an exception), the returned list becomes the instance under test.

public final AbstractListAssert<?, List<? extends Tuple>, Tuple, ObjectAssert<Tuple>>

Returns:

a new assertion object whose object under test is the list of Tuples containing the extracted values.
map
(Function<? super ELEMENT, ?>...
the mapper functions to extract a value from an element of the Iterable under test.
mappers
)

Use the given Functions to map the Iterable's elements into a List of Tuples (a simple data structure containing the mapped values), this new list becoming the object under test.

protected abstract SELF

Returns:

concrete instance of AbstractIterableAssert
newAbstractIterableAssert
(Iterable<? extends ELEMENT>
the iterable used to build the concrete instance of AbstractIterableAssert
iterable
)

This methods is needed to build a new concrete instance of AbstractIterableAssert after a filtering operation is executed.

protected SELF
newAbstractIterableAssertForProxy(List<ELEMENT> filteredIterable)

private <V> AbstractListAssert<?, List<? extends V>, V, ObjectAssert<V>>
public SELF
noneMatch(Predicate<? super ELEMENT>
the given Predicate.
predicate
)

Implements org.assertj.core.api.ObjectEnumerableAssert.noneMatch.

Verifies that no elements match the given Predicate.
public SELF
noneSatisfy(Consumer<? super ELEMENT>
the given restrictions as Consumer that no elements should met.
restrictions
)

Implements org.assertj.core.api.ObjectEnumerableAssert.noneSatisfy.

Verifies that no elements satisfy the given restrictions expressed as a Consumer.
public SELF
noneSatisfy(ThrowingConsumer<? super ELEMENT>
the given ThrowingConsumer.
restrictions
)

Implements org.assertj.core.api.ObjectEnumerableAssert.noneSatisfy.

Verifies that no elements satisfy the given restrictions expressed as a Consumer.
public SELF
overridingErrorMessage(String
the error message that will replace the default one provided by Assertj.
newErrorMessage
,
Object...
the args used to fill error message as in String#format(String, Object...).
args
)

Overrides org.assertj.core.api.AbstractAssert.overridingErrorMessage.

Overrides AssertJ default error message by the given one.
private static String
public final SELF
satisfiesExactly(Consumer<? super ELEMENT>...
the requirements to meet.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.satisfiesExactly.

Verifies that each element satisfies the requirements corresponding to its index, so the first element must satisfy the first requirements, the second element the second requirements etc...
public final SELF
satisfiesExactly(ThrowingConsumer<? super ELEMENT>...
the requirements to meet.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.satisfiesExactly.

Verifies that each element satisfies the requirements corresponding to its index, so the first element must satisfy the first requirements, the second element the second requirements etc...
protected SELF
satisfiesExactlyForProxy(Consumer<? super ELEMENT>[] requirements)

public final SELF
satisfiesExactlyInAnyOrder(Consumer<? super ELEMENT>...
the consumers that are expected to be satisfied by the elements of the given Iterable.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.satisfiesExactlyInAnyOrder.

Verifies that at least one combination of iterable elements exists that satisfies the consumers in order (there must be as many consumers as iterable elements and once a consumer is matched it cannot be reused to match other elements).
public final SELF
satisfiesExactlyInAnyOrder(ThrowingConsumer<? super ELEMENT>...
the consumers that are expected to be satisfied by the elements of the given Iterable.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.satisfiesExactlyInAnyOrder.

Verifies that at least one combination of iterable elements exists that satisfies the ThrowingConsumers in order (there must be as many consumers as iterable elements and once a consumer is matched it cannot be reused to match other elements).
protected SELF
satisfiesExactlyInAnyOrderForProxy(Consumer<? super ELEMENT>[] requirements)

public SELF
satisfiesOnlyOnce(Consumer<? super ELEMENT>
the Consumer that is expected to be satisfied only once by the elements of the given Iterable.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.satisfiesOnlyOnce.

Verifies that there is exactly one element in the iterable under tests that satisfies the Consumer.
public SELF
satisfiesOnlyOnce(ThrowingConsumer<? super ELEMENT>
the ThrowingConsumer that is expected to be satisfied only once by the elements of the given Iterable.
requirements
)

Implements org.assertj.core.api.ObjectEnumerableAssert.satisfiesOnlyOnce.

Verifies that there is exactly one element in the iterable under tests that satisfies the ThrowingConsumer.
protected SELF
satisfiesOnlyOnceForProxy(Consumer<? super ELEMENT> requirements)

public ELEMENT_ASSERT

Returns:

the assertion on the first element
singleElement
()

Verifies that the Iterable under test contains a single element and allows to perform assertions on that element.

public <
the type of the resulting Assert
ASSERT extends AbstractAssert<?, ?>
>
ASSERT

Returns:

a new narrowed Assert instance for assertions chaining on the single element
singleElement
(InstanceOfAssertFactory<?, ASSERT>
the factory which verifies the type and creates the new Assert
assertFactory
)

Verifies that the Iterable under test contains a single element and allows to perform assertions on that element, the assertions are strongly typed according to the given AssertFactory parameter.

public AbstractIterableSizeAssert<SELF, ACTUAL, ELEMENT, ELEMENT_ASSERT>

Returns:

AbstractIterableSizeAssert built with the Iterable's size.
size
()

Returns an Assert object that allows performing assertions on the size of the Iterable under test.

public final SELF
startsWith(ELEMENT...
the sequence of objects to look for.
sequence
)

Implements org.assertj.core.api.ObjectEnumerableAssert.startsWith.

Verifies that the actual group starts with the given sequence of objects, without any other objects between them.
protected SELF
startsWithForProxy(ELEMENT[] sequence)

protected abstract ELEMENT_ASSERT

Returns:

the assertion for the given element
toAssert
(ELEMENT
the element value
value
,
String
describes the element, ex: "check first element" for first(), used in assertion description.
description
)

This method is used in navigating assertions like first(), last() and element(int) to build the assertion for the given element navigated to.

public SELF
usingComparator(Comparator<? super ACTUAL>
the comparator to use for the incoming assertion checks.
customComparator
)

Overrides org.assertj.core.api.AbstractAssert.usingComparator.

Implements org.assertj.core.api.Assert.usingComparator.

Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.
public SELF
usingComparator(Comparator<? super ACTUAL>
the comparator to use for the incoming assertion checks.
customComparator
,
String
comparator description to be used in assertion error messages
customComparatorDescription
)

Overrides org.assertj.core.api.AbstractAssert.usingComparator.

Implements org.assertj.core.api.Assert.usingComparator.

Use the given custom comparator instead of relying on actual type A equals method for incoming assertion checks.
public <
the type of elements to compare.
T
>
SELF

Returns:

this assertions object
usingComparatorForElementFieldsWithNames
(Comparator<T> comparator, String...
the names of the properties and/or fields of the elements the comparator should be used for
elementPropertyOrFieldNames
)

Deprecated javadoc

Allows to set a comparator to compare properties or fields of elements with the given names.

public <
the type of elements to compare.
T
>
SELF

Returns:

this assertions object
usingComparatorForElementFieldsWithType
(Comparator<T> comparator, Class<T>
the java.lang.Class of the type of the element fields the comparator should be used for
type
)

Deprecated javadoc

Allows to set a specific comparator to compare properties or fields of elements with the given type.

public <
the type of elements to compare.
T
>
SELF

Returns:

this assertions object
usingComparatorForType
(Comparator<T> comparator, Class<T>
the java.lang.Class of the type of the element or element fields the comparator should be used for
type
)

Allows to set a specific comparator for the given type of elements or their fields.

protected SELF
public SELF
usingDefaultComparator()

Overrides org.assertj.core.api.AbstractAssert.usingDefaultComparator.

Implements org.assertj.core.api.Assert.usingDefaultComparator.

Revert to standard comparison for the incoming assertion checks.
public SELF
usingDefaultElementComparator()

Implements org.assertj.core.api.EnumerableAssert.usingDefaultElementComparator.

Revert to standard comparison for incoming assertion group element checks.
public SELF
usingElementComparator(Comparator<? super ELEMENT>
the comparator to use for incoming assertion checks.
elementComparator
)

Implements org.assertj.core.api.EnumerableAssert.usingElementComparator.

Use given custom comparator instead of relying on actual type A equals method to compare group elements for incoming assertion checks.
public SELF

Returns:

this assertion object.
usingElementComparatorIgnoringFields
(String...
the field names to exclude in the elements comparison.
fields
)

Deprecated This method is deprecated because it performs a shallow field by field comparison, i.e. elements are compared field by field but the fields are compared with equals, use usingRecursiveFieldByFieldElementComparatorIgnoringFields(String...) instead.
Deprecated javadoc

Use field/property by field/property comparison on all fields/properties except the given ones (including inherited fields/properties) instead of relying on actual type A equals method to compare group elements for incoming assertion checks.

public SELF

Returns:

this assertion object.
usingElementComparatorOnFields
(String...
the fields/properties to compare using element comparators
fields
)

Deprecated This method is deprecated because it performs a shallow field by field comparison, i.e. elements are compared field by field but the fields are compared with equals, use usingRecursiveFieldByFieldElementComparatorOnFields(String...) instead.
Deprecated javadoc

Use field/property by field/property comparison on the given fields/properties only (including inherited fields/properties) instead of relying on actual type A equals method to compare group elements for incoming assertion checks.

private SELF
public SELF

Returns:

this assertion object.
usingFieldByFieldElementComparator
()

Deprecated This method is deprecated because it performs a shallow field by field comparison, i.e. elements are compared field by field but the fields are compared with equals, use usingRecursiveFieldByFieldElementComparator() or usingRecursiveComparison() instead to perform a true recursive comparison.
Deprecated javadoc

Use field/property by field/property comparison (including inherited fields/properties) instead of relying on actual type A equals method to compare group elements for incoming assertion checks.

public RecursiveAssertionAssert

Returns:

A new instance of RecursiveAssertionAssert built with a default RecursiveAssertionConfiguration.
usingRecursiveAssertion
()

Overrides org.assertj.core.api.AbstractAssert.usingRecursiveAssertion.

Asserts that the given predicate is met for all fields of the object under test recursively (but not the object itself).

public RecursiveAssertionAssert

Returns:

A new instance of RecursiveAssertionAssert built with a default RecursiveAssertionConfiguration.
usingRecursiveAssertion
(RecursiveAssertionConfiguration
The recursion configuration described above.
recursiveAssertionConfiguration
)

Overrides org.assertj.core.api.AbstractAssert.usingRecursiveAssertion.

The same as usingRecursiveAssertion(), but this method allows the developer to pass in an explicit recursion configuration.

public RecursiveComparisonAssert<?>

Returns:

a new RecursiveComparisonAssert instance
usingRecursiveComparison
()

Overrides org.assertj.core.api.AbstractAssert.usingRecursiveComparison.

Enable using a recursive field by field comparison strategy when calling the chained RecursiveComparisonAssert,

There are differences between this approach and usingRecursiveFieldByFieldElementComparator(RecursiveComparisonConfiguration):

public RecursiveComparisonAssert<?>
public SELF

Returns:

this assertion object.
usingRecursiveFieldByFieldElementComparator
()

Enable using a recursive field by field comparison strategy similar to usingRecursiveComparison() but contrary to the latter you can chain any iterable assertions after this method (this is why this method exists).

public SELF

Returns:

this assertion object.
usingRecursiveFieldByFieldElementComparator
(RecursiveComparisonConfiguration
the recursive comparison configuration.
configuration
)

Enable using a recursive field by field comparison strategy similar to usingRecursiveComparison() but contrary to the latter you can chain any iterable assertions after this method (this is why this method exists).

public SELF

Returns:

this assertion object.
usingRecursiveFieldByFieldElementComparatorIgnoringFields
(String...
the field names to exclude in the elements comparison.
fields
)

The assertions chained after this method will use a recursive field by field comparison on all fields (including inherited fields) except the given ones instead of relying on the element equals method.

public SELF

Returns:

this assertion object.
usingRecursiveFieldByFieldElementComparatorOnFields
(String...
the field names to exclude in the elements comparison.
fields
)

The assertions chained after this method will use a recursive field by field comparison on the given fields (including inherited fields) instead of relying on the element equals method.

pack-priv SELF
pack-priv SELF
withComparatorsForElementPropertyOrFieldNames(Map<String, Comparator<?>> comparatorsForElementPropertyOrFieldNames)

pack-priv SELF
withComparatorsForElementPropertyOrFieldTypes(TypeComparators comparatorsForElementPropertyOrFieldTypes)

public SELF
withFailMessage(String
the error message that will replace the default one provided by Assertj.
newErrorMessage
,
Object...
the args used to fill error message as in String#format(String, Object...).
args
)

Overrides org.assertj.core.api.AbstractAssert.withFailMessage.

Alternative method for AbstractAssert#overridingErrorMessage

You must set it before calling the assertion otherwise it is ignored as the failing assertion breaks the chained call by throwing an AssertionError.

pack-priv SELF
public SELF
withThreadDumpOnError()

Overrides org.assertj.core.api.AbstractAssert.withThreadDumpOnError.

Implements org.assertj.core.api.Assert.withThreadDumpOnError.

In case of an assertion error, a thread dump will be printed to System#err.
pack-priv SELF
public <
the type of the other iterable elements.
OTHER_ELEMENT
>
SELF

Returns:

this assertion object.
zipSatisfy
(Iterable<OTHER_ELEMENT>
the iterable to zip actual with.
other
,
BiConsumer<? super ELEMENT, OTHER_ELEMENT>
the given requirements that each pair must satisfy.
zipRequirements
)

Verifies that the zipped pairs of actual and other elements, i.e: (actual 1st element, other 1st element), (actual 2nd element, other 2nd element), ...

Inherited from org.assertj.core.api.AbstractAssert:
areEqualasInstanceOfasListassertionErrorasStringdescriptionTextdoesNotHaveSameHashCodeAsdoesNotHaveToStringdoesNotHaveToStringequalsextractingextractingfailurefailureWithActualExpectedfailWithActualExpectedAndMessagefailWithMessagegetWritableAssertionInfohashCodehasSameHashCodeAshasToStringisElementOfCustomAssertisInstanceOfSatisfyingisNullmatchesmatchesnewListAssertInstanceoverridingErrorMessagesatisfiessatisfiessatisfiessatisfiesAnyOfsatisfiesAnyOfsatisfiesAnyOfForProxysatisfiesForProxysetCustomRepresentationsetDescriptionConsumersetPrintAssertionsDescriptionthrowAssertionErrorwithFailMessagewithRepresentation