Class Truth8


  • public final class Truth8
    extends Object
    The primary entry point for assertions about Java 8 types.

    To use Truth.assertWithMessage(java.lang.String) with a Java 8 type, use assertWithMessage(...).about(optionals()).that(...) (or similarly for the other types).

    Likewise, to use different failure strategies like Expect, use expect.about(optionals()).that(...).

    For more information about combining different messages, failure strategies, and subjects, see How do I specify a custom message/failure behavior/Subject type? in the Truth FAQ.