AssertJIntegerRules

SUGGESTION

Simplification

View source code on GitHub

Suppression

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

Table of contents
  1. AbstractIntegerAssertIsEqualTo
  2. AbstractIntegerAssertIsNotEqualTo
  3. AbstractIntegerAssertIsEqualToZero
  4. AbstractIntegerAssertIsNotEqualToZero
  5. AbstractIntegerAssertIsEqualToOne

AbstractIntegerAssertIsEqualTo

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 ImmutableSet<AbstractIntegerAssert<?>> testAbstractIntegerAssertIsEqualTo() {
-  return ImmutableSet.of(
-      assertThat(1).isCloseTo(2, offset(0)), assertThat(1).isCloseTo(2, withPercentage(0)));
+  return ImmutableSet.of(assertThat(1).isEqualTo(2), assertThat(1).isEqualTo(2));
 }

AbstractIntegerAssertIsNotEqualTo

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 ImmutableSet<AbstractIntegerAssert<?>> testAbstractIntegerAssertIsNotEqualTo() {
-  return ImmutableSet.of(
-      assertThat(1).isNotCloseTo(2, offset(0)), assertThat(1).isNotCloseTo(2, withPercentage(0)));
+  return ImmutableSet.of(assertThat(1).isNotEqualTo(2), assertThat(1).isNotEqualTo(2));
 }

AbstractIntegerAssertIsEqualToZero

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 AbstractIntegerAssert<?> testAbstractIntegerAssertIsEqualToZero() {
-  return assertThat(1).isZero();
+  return assertThat(1).isEqualTo(0);
 }

AbstractIntegerAssertIsNotEqualToZero

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 AbstractIntegerAssert<?> testAbstractIntegerAssertIsNotEqualToZero() {
-  return assertThat(1).isNotZero();
+  return assertThat(1).isNotEqualTo(0);
 }

AbstractIntegerAssertIsEqualToOne

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 AbstractIntegerAssert<?> testAbstractIntegerAssertIsEqualToOne() {
-  return assertThat(1).isOne();
+  return assertThat(1).isEqualTo(1);
 }

Copyright © 2017-2026 Picnic Technologies BV