I have written a piece of code and I have written both unit and integration tests to cover it. The PR is failing because SonarQube says that the line coverage is below the threshold because the if conditions are not covered. On the other hand, IntelliJ is suggesting that the coverage is 100% for this class.
Optional<Book> bookOptional = bookPersistence.findBookFor(book.id);
bookOptional.ifPresent(book -> {
if (book.title != "something") {
throw new SomeException("cause");
}
});