AssertJIteratorRules
SUGGESTION
Simplification
Suppression
Disable all rules by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJIteratorRules\$).*
as compiler argument.
Table of contents
AssertThatHasNext
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AssertThatHasNext")
to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJIteratorRules\$AssertThatHasNext).*
as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
AbstractAssert<?, ?> testAssertThatHasNext() {
- return assertThat(ImmutableSet.of().iterator().hasNext()).isTrue();
+ return assertThat(ImmutableSet.of().iterator()).hasNext();
}
AssertThatIsExhausted
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("AssertThatIsExhausted")
to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!AssertJIteratorRules\$AssertThatIsExhausted).*
as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
AbstractAssert<?, ?> testAssertThatIsExhausted() {
- return assertThat(ImmutableSet.of().iterator().hasNext()).isFalse();
+ return assertThat(ImmutableSet.of().iterator()).isExhausted();
}