AssertJByteRules

SUGGESTION

Simplification

View source code on GitHub

Suppression

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

Table of contents
  1. AbstractByteAssertIsEqualTo
  2. AbstractByteAssertIsNotEqualTo
  3. AbstractByteAssertIsEqualToZero
  4. AbstractByteAssertIsNotEqualToZero
  5. AbstractByteAssertIsEqualToOne

AbstractByteAssertIsEqualTo

SUGGESTION

Simplification

Suppression

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

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

Samples

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

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

AbstractByteAssertIsNotEqualTo

SUGGESTION

Simplification

Suppression

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

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

Samples

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

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

AbstractByteAssertIsEqualToZero

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 AbstractByteAssert<?> testAbstractByteAssertIsEqualToZero() {
-  return assertThat((byte) 1).isZero();
+  return assertThat((byte) 1).isEqualTo((byte) 0);
 }

AbstractByteAssertIsNotEqualToZero

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 AbstractByteAssert<?> testAbstractByteAssertIsNotEqualToZero() {
-  return assertThat((byte) 1).isNotZero();
+  return assertThat((byte) 1).isNotEqualTo((byte) 0);
 }

AbstractByteAssertIsEqualToOne

SUGGESTION

Simplification

Suppression

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

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

Samples

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

 AbstractByteAssert<?> testAbstractByteAssertIsEqualToOne() {
-  return assertThat((byte) 1).isOne();
+  return assertThat((byte) 1).isEqualTo((byte) 1);
 }

Copyright © 2017-2026 Picnic Technologies BV