Equality not working as expected with Kotlin code testing Java class?

What do you mean by “without modifying the original Java”?

Sorry I should have specified that in tinkering around a bit I had changed the equality check from if (listItem == value) to if (listItem.equals(value)) to experiment and the tests passed. This makes sense given your comment about checking object identity. But I didn’t want to modify this original code, I was just trying it out b/c I was confused about the issue.

Thanks for the suggestion on adding Int? as the type, that made the test pass. If you have any extra time could you give me a brief lesson on why this fixes the auto-boxing issue you mentioned?