public final class Correspondences
extends java.lang.Object
Correspondence
s for constructing fluent assertions for collection elements.Modifier and Type | Method and Description |
---|---|
static <T> com.google.common.truth.Correspondence<T,java.lang.Class<?>> |
type()
Obtains a
Correspondence of an object to its type. |
public static <T> com.google.common.truth.Correspondence<T,java.lang.Class<?>> type()
Correspondence
of an object to its type.
Elements of a collection can be matched to their class using this correspondence.
Example:
assertThat(objects)
.comparingElementsUsing(type())
.containsExactly(String.class, String.class);
T
- type of the input object