Truth has built in support for the following types:
-
Primitives
-
Arrays
-
Other JDK types
Object
- since all types extendObject
, you can make simple assertions such as.isEqualTo()
on any typeString
Comparable
- this can be used for anyComparable
type (Instant
,BigInteger
, etc.)Iterable
- this can be used for anyIterable
type (List
,Set
, etc.)Optional
- andOptionalInt
,OptionalLong
, andOptionalDouble
Stream
- andIntStream
,LongStream
(and maybe somedayDoubleStream
)Map
Throwable
Class
BigDecimal
-
Guava types
Truth is extensible, so if you don’t see a type you need to make assertions on in this list, you can write your own.