The arguments to assertThat method is a constant. It should be a variable or a method invocation. For eg. switch assertThat(1).isEqualTo(methodCall()) to assertThat(methodCall()).isEqualTo(1).
Suppress false positives by adding the suppression annotation @SuppressWarnings("TruthConstantAsserts")
to the enclosing element.