AssertJBooleanRules

SUGGESTION

Simplification

View source code on GitHub

Suppression

Disable all rules by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBooleanRules\$).* as compiler argument.

Table of contents
  1. AbstractBooleanAssertIsEqualTo
  2. AbstractBooleanAssertIsNotEqualTo
  3. AbstractBooleanAssertIsTrue
  4. AssertThatIsTrue
  5. AbstractBooleanAssertIsFalse
  6. AssertThatIsFalse

AbstractBooleanAssertIsEqualTo

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractBooleanAssertIsEqualTo") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBooleanRules\$AbstractBooleanAssertIsEqualTo).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 AbstractBooleanAssert<?> testAbstractBooleanAssertIsEqualTo() {
-  return assertThat(true).isNotEqualTo(!Boolean.FALSE);
+  return assertThat(true).isEqualTo(Boolean.FALSE);
 }

AbstractBooleanAssertIsNotEqualTo

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractBooleanAssertIsNotEqualTo") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBooleanRules\$AbstractBooleanAssertIsNotEqualTo).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 AbstractBooleanAssert<?> testAbstractBooleanAssertIsNotEqualTo() {
-  return assertThat(true).isEqualTo(!Boolean.FALSE);
+  return assertThat(true).isNotEqualTo(Boolean.FALSE);
 }

AbstractBooleanAssertIsTrue

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractBooleanAssertIsTrue") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBooleanRules\$AbstractBooleanAssertIsTrue).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<AbstractBooleanAssert<?>> testAbstractBooleanAssertIsTrue() {
-  return ImmutableSet.of(assertThat(true).isEqualTo(true), assertThat(false).isNotEqualTo(false));
+  return ImmutableSet.of(assertThat(true).isTrue(), assertThat(false).isTrue());
 }

AssertThatIsTrue

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AssertThatIsTrue") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBooleanRules\$AssertThatIsTrue).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 AbstractBooleanAssert<?> testAssertThatIsTrue() {
-  return assertThat(!Boolean.TRUE).isFalse();
+  return assertThat(Boolean.TRUE).isTrue();
 }

AbstractBooleanAssertIsFalse

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AbstractBooleanAssertIsFalse") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBooleanRules\$AbstractBooleanAssertIsFalse).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 ImmutableSet<AbstractBooleanAssert<?>> testAbstractBooleanAssertIsFalse() {
-  return ImmutableSet.of(assertThat(true).isEqualTo(false), assertThat(false).isNotEqualTo(true));
+  return ImmutableSet.of(assertThat(true).isFalse(), assertThat(false).isFalse());
 }

AssertThatIsFalse

SUGGESTION

Simplification

Suppression

Suppress false positives by adding the suppression annotation @SuppressWarnings("AssertThatIsFalse") to the enclosing element.

Disable this rule by adding -XepOpt:Refaster:NamePattern=^(?!AssertJBooleanRules\$AssertThatIsFalse).* as compiler argument.

Samples

Shows the difference in example code before and after the Refaster rule is applied.

 AbstractBooleanAssert<?> testAssertThatIsFalse() {
-  return assertThat(!Boolean.TRUE).isTrue();
+  return assertThat(Boolean.TRUE).isFalse();
 }

Copyright © 2017-2026 Picnic Technologies BV