public final class SortedSetSubject extends IterableSubject
SortedSet
and NavigableSet
objects. This class supports assertions
based on NavigableSet
's API even if the subject only implements SortedSet
.IterableSubject.UsingCorrespondence<A,E>
Modifier and Type | Method and Description |
---|---|
void |
hasFirstElement(Object element)
Fails if the subject does not have the given first element.
|
void |
hasLastElement(Object element)
Fails if the subject does not have the given last element.
|
SortedSetSubject |
named(String format,
Object... args)
Adds a prefix to the subject, when it is displayed in error messages.
|
actualCustomStringRepresentation, comparingElementsUsing, contains, containsAllIn, containsAllIn, containsAllOf, containsAnyIn, containsAnyIn, containsAnyOf, containsExactly, containsExactlyElementsIn, containsExactlyElementsIn, containsNoDuplicates, containsNoneIn, containsNoneIn, containsNoneOf, doesNotContain, hasSize, isEmpty, isNoneOf, isNotEmpty, isNotIn, isOrdered, isOrdered, isStrictlyOrdered, isStrictlyOrdered
actual, actualAsString, check, check, equals, fail, fail, fail, failComparing, failComparing, failWithActual, failWithActual, failWithBadResults, failWithCustomSubject, failWithoutActual, failWithoutActual, failWithoutSubject, failWithRawMessage, failWithRawMessageAndCause, getSubject, hashCode, ignoreCheck, internalCustomName, isAnyOf, isEqualTo, isIn, isInstanceOf, isNotEqualTo, isNotInstanceOf, isNotNull, isNotSameAs, isNull, isSameAs, toString
public SortedSetSubject named(String format, Object... args)
Subject
toString()
representation, e.g. boolean.
Writing assertThat(foo).named("foo").isTrue();
then results in a more reasonable error
message.
named()
takes a format template and argument objects which will be substituted into
the template using Strings.lenientFormat
.
Note this only supports the %s
specifier.
named
in class Subject<IterableSubject,Iterable<?>>
format
- a template with %s
placeholdersargs
- the object parameters which will be applied to the message template.public void hasFirstElement(@NullableDecl Object element)
public void hasLastElement(@NullableDecl Object element)
Copyright © 2018. All rights reserved.